/**
 * SVG Unified - Client Dashboard Styles
 * Version: 2.0
 * Description: Enhanced styles for Client dashboard with Amelia integration
 */

/* Main Dashboard Adjustments */
.svg-client-dashboard {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
}

/* Dashboard Header */
.svg-dashboard-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.svg-dashboard-header h1 {
    margin: 0 0 10px 0;
    font-size: 28px;
    font-weight: 700;
}

.svg-dashboard-header p {
    margin: 0;
    opacity: 0.9;
    font-size: 16px;
    font-weight: 400;
}

/* Stats Grid */
.svg-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.svg-stat-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #f0f0f0;
}

.svg-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.svg-stat-card h4 {
    margin: 0 0 5px 0;
    color: #2c3e50;
    font-size: 14px;
    font-weight: 600;
    text-align: left;
}

.svg-stat-card p {
    margin: 0;
    font-size: 28px;
    font-weight: bold;
    color: #007bff;
}

.svg-stat-card small {
    color: #6c757d;
    font-size: 11px;
}

/* Dashboard Tabs */
.svg-dashboard-tabs {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
    border: 1px solid #e1e5e9;
}

.svg-tab-nav {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.svg-tab-btn {
    flex: 1;
    padding: 15px 20px;
    border: none;
    background: none;
    cursor: pointer;
    font-weight: 600;
    color: #6c757d;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    font-size: 14px;
}

.svg-tab-btn:hover {
    background: #e9ecef;
    color: #495057;
}

.svg-tab-btn.active {
    color: #007bff;
    border-bottom-color: #007bff;
    background: white;
}

.svg-tab-content {
    padding: 30px 30px 40px 30px;
}

.svg-tab-panel {
    display: none;
}

.svg-tab-panel.active {
    display: block;
}

/* Refresh Button */
.svg-refresh-btn {
    background: #f8f9fa;
    color: #6c757d;
    border: 1px solid #e1e5e9;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.svg-refresh-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    color: #495057;
}

.svg-refresh-btn:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.svg-refresh-btn:active {
    background: #dee2e6;
    transform: scale(0.98);
}

/* Calendar Panel Constraints */
#calendar-content {
    overflow: hidden;
}

#calendar-content .amelia-booking-calendar,
#calendar-content .amelia-employee-panel,
#calendar-content .amelia-customer-panel,
#calendar-content #amelia-app-booking,
#calendar-content [id*="amelia"] {
    max-width: 100% !important;
    width: 100% !important;
    overflow-x: auto;
    box-sizing: border-box;
}

/* Ensure Amelia components respect container width */
#calendar-content .amelia-app-booking .am-calendar-booking,
#calendar-content .amelia-app-booking .am-employee-panel,
#calendar-content .amelia-app-booking .am-customer-panel {
    width: 100% !important;
    max-width: none !important;
}

/* Fix for Amelia calendar responsiveness */
#calendar-content .amelia-app-booking .am-calendar-appointments {
    overflow-x: auto;
    width: 100%;
}

/* Loading and Error States */
.svg-loading {
    text-align: center;
    padding: 20px;
    color: #6c757d;
    font-style: italic;
}

.svg-error {
    text-align: center;
    padding: 20px;
    color: #dc3545;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    margin: 10px 0;
}

.svg-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.svg-empty-state h3 {
    margin: 0 0 8px 0;
    color: #495057;
    font-size: 18px;
    font-weight: 600;
}

.svg-empty-state p {
    margin: 0;
    font-size: 14px;
    color: #6c757d;
}

/* Booking Table Styles */
.svg-booking-table-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
    margin: 20px 0;
    border: 1px solid #e1e5e9;
}

.svg-booking-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.svg-booking-table thead {
    background: #f8f9fa;
    border-bottom: 2px solid #e1e5e9;
}

.svg-booking-table th {
    padding: 16px 12px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-right: 1px solid #e1e5e9;
}

.svg-booking-table th:last-child {
    border-right: none;
}

.svg-booking-table tbody tr {
    border-bottom: 1px solid #e1e5e9;
    transition: background 0.2s ease;
}

.svg-booking-table tbody tr:nth-child(even) {
    background: #f8f9fa;
}

.svg-booking-table tbody tr:hover {
    background: #e3f2fd !important;
}

.svg-booking-table td {
    padding: 16px 12px;
    border-right: 1px solid #e1e5e9;
    vertical-align: top;
}

.svg-booking-table td:last-child {
    border-right: none;
}

/* Status Badges */
.svg-status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    color: white;
    display: inline-block;
    text-transform: uppercase;
}

.svg-status-approved {
    background: #28a745;
}

.svg-status-pending {
    background: #ffc107;
    color: #212529;
}

.svg-status-completed {
    background: #17a2b8;
}

.svg-status-canceled {
    background: #dc3545;
}

/* Subscription Cards */
.svg-subscription-card {
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: box-shadow 0.2s ease;
}

.svg-subscription-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.svg-subscription-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.svg-subscription-title {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
    line-height: 1.3;
}

.svg-subscription-status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.svg-subscription-status.active {
    background: #d4edda;
    color: #155724;
}

.svg-subscription-status.pending {
    background: #fff3cd;
    color: #856404;
}

.svg-subscription-status.cancelled {
    background: #f8d7da;
    color: #721c24;
}

.svg-subscription-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.svg-subscription-detail {
    text-align: center;
}

.svg-subscription-detail-label {
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 5px;
    font-weight: 500;
}

.svg-subscription-detail-value {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
}

/* Subscription Actions */
.svg-subscription-actions {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e1e5e9;
}

.svg-booking-btn {
    display: inline-block;
    background: #28a745;
    color: white;
    padding: 12px 24px;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.svg-booking-btn:hover {
    background: #218838;
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

.svg-credits-maxed {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 6px;
    padding: 12px;
    text-align: center;
}

.svg-credits-maxed p {
    margin: 0;
    color: #856404;
    font-weight: 500;
    font-size: 14px;
}

.svg-credits-maxed small {
    color: #6c757d;
    font-size: 12px;
}

.svg-subscription-inactive {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
    padding: 12px;
    text-align: center;
}

.svg-subscription-inactive p {
    margin: 0;
    color: #721c24;
    font-weight: 500;
    font-size: 14px;
}

.svg-subscription-inactive small {
    color: #6c757d;
    font-size: 12px;
}

/* Profile Status Card */
.svg-profile-status-card {
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.svg-profile-status-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.svg-profile-status-title {
    font-size: 24px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 10px 0;
}

.svg-profile-status-description {
    color: #6c757d;
    margin-bottom: 20px;
    font-size: 16px;
}

.svg-profile-action-btn {
    display: inline-block;
    padding: 12px 24px;
    background: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: background 0.2s ease;
    font-size: 14px;
}

.svg-profile-action-btn:hover {
    background: #0056b3;
    color: white;
    text-decoration: none;
}

/* Quick Actions Footer */
.svg-quick-actions {
    margin-top: 30px;
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border: 1px solid #e1e5e9;
}

.svg-quick-actions h3 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 18px;
    font-weight: 600;
}

.svg-quick-actions .button {
    display: block;
    text-align: center;
    padding: 15px;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s ease;
    font-size: 14px;
}

.svg-quick-actions .button:hover {
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Responsive Design */
@media (max-width: 768px) {
    .svg-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .svg-stat-card {
        padding: 15px !important;
    }
    
    .svg-stat-card h4 {
        font-size: 12px !important;
    }
    
    .svg-stat-card p {
        font-size: 24px !important;
    }
    
    .svg-tab-nav {
        flex-direction: column;
    }
    
    .svg-tab-btn {
        border-bottom: 1px solid #dee2e6 !important;
        border-right: none !important;
        padding: 12px 15px !important;
        font-size: 14px !important;
    }
    
    .svg-tab-btn.active {
        border-bottom-color: #007bff !important;
    }
    
    .svg-tab-content {
        padding: 20px 20px 30px 20px !important;
    }
    
    .svg-refresh-btn {
        padding: 6px 12px !important;
        font-size: 12px !important;
    }
    
    .svg-booking-table-container {
        overflow-x: auto;
    }
    
    .svg-booking-table {
        min-width: 800px;
    }
    
    .svg-subscription-details {
        grid-template-columns: 1fr;
    }
    
    .svg-dashboard-header {
        padding: 20px;
    }
    
    .svg-dashboard-header h1 {
        font-size: 24px;
    }
    
    .svg-dashboard-header p {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .svg-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .svg-quick-actions .button {
        padding: 12px;
        font-size: 13px;
    }
    
    .svg-profile-status-card {
        padding: 20px;
    }
    
    .svg-profile-status-title {
        font-size: 20px;
    }
    
    .svg-profile-status-icon {
        font-size: 40px;
    }

    /* Work Review Mobile Optimization */
    .svg-work-card {
        padding: 15px !important;
    }

    .svg-work-header {
        flex-direction: column;
        align-items: flex-start !important;
    }

    .svg-work-video {
        width: 100% !important;
        height: auto !important;
        min-height: 200px;
    }

    .svg-review-actions {
        flex-direction: column;
        gap: 10px;
    }

    .svg-review-actions .button {
        width: 100%;
        margin: 0 !important;
        justify-content: center;
        min-height: 48px; /* Touch-friendly */
    }

    /* Feedback Textarea */
    .svg-feedback-section textarea {
        font-size: 16px !important; /* Prevent iOS zoom */
        min-height: 120px;
    }

    /* Video Embed Responsive */
    .svg-video-container {
        position: relative;
        padding-bottom: 56.25%; /* 16:9 */
        height: 0;
        overflow: hidden;
    }

    .svg-video-container iframe {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
    }
}

/* Enhanced Mobile-First CSS for Client Dashboard */
@media (max-width: 768px) {
    /* Tab Navigation */
    .svg-tab-nav {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }

    .svg-tab-btn {
        min-width: 120px;
        font-size: 14px;
        padding: 12px 16px;
    }

    /* Chat Messages */
    .svg-chat-message {
        max-width: 85% !important;
    }

    /* Modal Full Screen */
    .svg-modal {
        padding: 10px;
    }

    .svg-modal-content {
        width: 100%;
        max-width: 100%;
        margin: 0;
        border-radius: 12px;
    }

    /* Touch-Optimized Inputs */
    input, textarea, select {
        font-size: 16px !important;
        min-height: 44px;
    }
}
