/* Cosmetic Analyzer Frontend Styles */

/* Reset and Base Styles */
.ca-container * {
    box-sizing: border-box;
}

.ca-container {
    font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
    direction: rtl;
}

/* Header Styles */
.ca-header {
    text-align: center;
    margin-bottom: 3rem;
}

.ca-header-icon {
    width: 4rem;
    height: 4rem;
    background: #10b981;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    color: white;
}

.ca-header h1 {
    font-size: 2.5rem;
    color: #1f2937;
    margin-bottom: 1rem;
    font-weight: bold;
}

.ca-header p {
    font-size: 1.125rem;
    color: #6b7280;
    max-width: 48rem;
    margin: 0 auto;
}

/* Progress Steps */
.ca-progress-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 3rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.ca-progress-step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 2rem;
    transition: all 0.3s;
    background: #f3f4f6;
    color: #6b7280;
}

.ca-progress-step.active {
    background: #d1fae5;
    color: #065f46;
}

.ca-progress-arrow {
    color: #9ca3af;
    margin: 0 0.5rem;
}

/* Grid Layout */
.ca-main-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
    align-items: start;
}

@media (max-width: 1024px) {
    .ca-main-grid {
        grid-template-columns: 1fr;
    }
}

/* Card Component */
.ca-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    overflow: hidden;
    margin-bottom: 2rem;
}

.ca-card-header {
    padding: 1.5rem;
    text-align: center;
    border-bottom: 1px solid #e5e7eb;
}

.ca-card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.ca-card-description {
    color: #6b7280;
    font-size: 0.875rem;
}

.ca-card-content {
    padding: 1.5rem;
}

/* Button Component */
.ca-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    font-size: 14px;
}

.ca-btn-primary {
    background: #10b981;
    color: white;
}

.ca-btn-primary:hover {
    background: #059669;
}

.ca-btn-primary:disabled {
    background: #d1d5db;
    cursor: not-allowed;
}

.ca-btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

.ca-btn-secondary:hover {
    background: #e5e7eb;
}
.ca-btn-success {
    background: #059669;
    color: white;
}

.ca-btn-success:hover {
    background: #047857;
}

.ca-btn-success:disabled {
    background: #d1d5db;
    cursor: not-allowed;
}

/* Badge Component */
.ca-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.ca-badge-secondary {
    background: #f3f4f6;
    color: #374151;
}

.ca-badge-success {
    background: #d1fae5;
    color: #065f46;
}

/* Material Selector */
.ca-material-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ca-material-item {
    padding: 1rem;
    border-radius: 0.75rem;
    border: 2px solid #e5e7eb;
    cursor: pointer;
    transition: all 0.3s;
    background: white;
}

.ca-material-item:hover {
    border-color: #d1d5db;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.ca-material-item.selected {
    border-color: #10b981;
    background: #f0fdf4;
}

.ca-material-item-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ca-material-info h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.ca-material-info p {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

.ca-check-icon {
    width: 1.5rem;
    height: 1.5rem;
    background: #10b981;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

/* Part Selector */
.ca-parts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.ca-part-item {
    padding: 1rem;
    border-radius: 0.75rem;
    border: 2px solid #e5e7eb;
    cursor: pointer;
    transition: all 0.3s;
    background: white;
}

.ca-part-item:hover {
    border-color: #d1d5db;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.ca-part-item.selected {
    border-color: #3b82f6;
    background: #eff6ff;
}

.ca-part-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.ca-checkbox {
    width: 1.5rem;
    height: 1.5rem;
    border: 2px solid #d1d5db;
    border-radius: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.ca-checkbox.checked {
    background: #3b82f6;
    border-color: #3b82f6;
    color: white;
}

.ca-part-info h4 {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.ca-part-info p {
    font-size: 0.875rem;
    color: #6b7280;
}

/* Action Bar */
.ca-action-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 0;
    border-top: 1px solid #e5e7eb;
    margin-top: 1rem;
}

.ca-selected-count {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.ca-actions {
    display: flex;
    gap: 0.75rem;
}

/* Tabs Component */
.ca-tabs {
    margin-top: 2rem;
}

.ca-tabs-list {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.ca-tab-trigger {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid #d1d5db;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.ca-tab-trigger.active {
    background: #d1fae5;
    color: #065f46;
    border-color: #10b981;
}

.ca-tab-content {
    display: none;
}

.ca-tab-content.active {
    display: block;
}

/* Table Component */
.ca-table-container {
    overflow-x: auto;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    margin: 1rem 0;
}

.ca-table {
    width: 100%;
    border-collapse: collapse;
}

.ca-table th,
.ca-table td {
    padding: 0.75rem;
    text-align: right;
    border-bottom: 1px solid #e5e7eb;
}

.ca-table th {
    background: #f9fafb;
    font-weight: 600;
    color: #374151;
}

.ca-table tbody tr:hover {
    background: #f9fafb;
}

/* Section Cards */
.ca-section-card {
    border-right: 4px solid;
    margin-bottom: 1.5rem;
    background: white;
    border-radius: 0.5rem;
    overflow: hidden;
}

.ca-section-card.lipids { border-right-color: #8b5cf6; }
.ca-section-card.vitamins { border-right-color: #f59e0b; }
.ca-section-card.proteins { border-right-color: #ef4444; }
.ca-section-card.carbs { border-right-color: #f59e0b; }
.ca-section-card.minerals { border-right-color: #6b7280; }
.ca-section-card.phyto { border-right-color: #10b981; }
.ca-section-card.beneficial { border-right-color: #10b981; }
.ca-section-card.stability { border-right-color: #3b82f6; }
.ca-section-card.summary { border-right-color: #6366f1; }

.ca-section-header {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.ca-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.ca-section-content {
    padding: 1.5rem;
}

.ca-subsection {
    margin-bottom: 2rem;
}

.ca-subsection h4 {
    font-weight: 600;
    color: #374151;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ca-color-dot {
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
}

.ca-separator {
    height: 1px;
    background: #e5e7eb;
    margin: 1.5rem 0;
}

/* Summary Styles */
.ca-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.ca-summary-item {
    background: #f9fafb;
    padding: 1rem;
    border-radius: 0.5rem;
}

.ca-summary-item h5 {
    font-weight: 600;
    color: #374151;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.ca-summary-item p {
    font-size: 0.875rem;
    color: #6b7280;
}

.ca-applications-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 0.75rem;
}

.ca-application-item {
    background: #eef2ff;
    padding: 0.75rem;
    border-radius: 0.5rem;
}

.ca-application-item .title {
    font-weight: 500;
    color: #1e40af;
    margin-bottom: 0.25rem;
}

.ca-application-item .benefit {
    font-size: 0.875rem;
    color: #1e40af;
}

/* Icons */
.ca-icon {
    width: 1.25rem;
    height: 1.25rem;
    fill: currentColor;
}

/* Utility Classes */
.ca-hidden {
    display: none !important;
}

.ca-loading {
    text-align: center;
    padding: 2rem;
    color: #6b7280;
}

/* Responsive */
@media (max-width: 768px) {
    .ca-main-grid {
        grid-template-columns: 1fr;
    }
    
    .ca-progress-steps {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .ca-parts-grid {
        grid-template-columns: 1fr;
    }
    
    .ca-tabs-list {
        flex-direction: column;
    }
    
    .ca-action-bar {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .ca-actions {
        justify-content: center;
    }
}