/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #1f2937;
    background-color: #f8fafc;
    overflow-x: hidden;
}

/* App Container */
#app {
    position: relative;
    min-height: 100vh;
}

/* Screen Management */
.screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease-in-out;
    z-index: 1;
}

.screen.active {
    opacity: 1;
    visibility: visible;
    z-index: 10;
}

/* Loading Screen */
#loading-screen {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.loading-container {
    text-align: center;
    animation: fadeInUp 0.8s ease-out;
}

.logo-container {
    width: 120px;
    height: 120px;
    border-radius: 60px;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    backdrop-filter: blur(10px);
}

.logo-container i {
    font-size: 60px;
}

.loading-container h1 {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 24px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

/* Welcome Screen */
#welcome-screen {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.gradient-bg {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.welcome-content {
    max-width: 600px;
    width: 100%;
    text-align: center;
    color: white;
    animation: fadeInUp 0.8s ease-out;
}

.welcome-content .header {
    margin-bottom: 60px;
}

.welcome-content h1 {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 12px;
}

.welcome-content .subtitle {
    font-size: 18px;
    opacity: 0.9;
    line-height: 1.5;
}

.features {
    margin-bottom: 60px;
}

.feature {
    margin-bottom: 32px;
}

.feature h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.feature p {
    font-size: 16px;
    opacity: 0.8;
    line-height: 1.4;
}

.user-type-section {
    margin-bottom: 60px;
}

.user-type-section h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 24px;
}

.user-type-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
}

.user-type-card {
    flex: 1;
    max-width: 200px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.user-type-card:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

.user-type-card i {
    font-size: 32px;
    margin-bottom: 12px;
}

.user-type-card h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.user-type-card p {
    font-size: 14px;
    opacity: 0.8;
    line-height: 1.3;
}

/* Auth Screens */
.auth-container {
    max-width: 400px;
    margin: 0 auto;
    padding: 40px 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #f8fafc;
}

.back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    color: #6b7280;
    font-size: 16px;
    cursor: pointer;
    margin-bottom: 32px;
    padding: 8px 0;
    transition: color 0.2s ease;
}

.back-btn:hover {
    color: #374151;
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-header h2 {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 8px;
    color: #1f2937;
}

.auth-header p {
    font-size: 16px;
    color: #6b7280;
}

.user-type-selector {
    display: flex;
    background: #e5e7eb;
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 24px;
}

.user-type-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #6b7280;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.user-type-btn.active {
    background: #667eea;
    color: white;
}

.auth-form {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    margin-bottom: 24px;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #374151;
}

.input-group input,
.input-group select,
.input-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    font-size: 16px;
    background: #f9fafb;
    color: #1f2937;
    transition: all 0.2s ease;
}

.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.input-group textarea {
    resize: vertical;
    min-height: 80px;
}

.auth-footer {
    text-align: center;
}

.auth-footer p {
    color: #6b7280;
    font-size: 16px;
}

.demo-info {
    text-align: center;
    margin-top: 24px;
}

.demo-info h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #374151;
}

.quick-login-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.quick-login-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quick-login-btn.primary {
    background: rgba(102, 126, 234, 0.2);
    color: #667eea;
}

.quick-login-btn.secondary {
    background: rgba(139, 92, 246, 0.2);
    color: #8b5cf6;
}

.quick-login-btn:hover {
    transform: translateY(-1px);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    gap: 8px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #5a67d8;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #e5e7eb;
    color: #374151;
}

.btn-secondary:hover:not(:disabled) {
    background: #d1d5db;
}

.btn-link {
    background: none;
    border: none;
    color: #667eea;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
}

.btn-link:hover {
    color: #5a67d8;
}

.btn-icon {
    width: 44px;
    height: 44px;
    border-radius: 22px;
    border: none;
    background: #f3f4f6;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: #e5e7eb;
    color: #374151;
}

/* Dashboard Layout */
.navbar {
    background: white;
    border-bottom: 1px solid #e5e7eb;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: bold;
    color: #1f2937;
}

.nav-brand i {
    color: #667eea;
    font-size: 24px;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-user span {
    font-weight: 600;
    color: #374151;
}

.dashboard-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
}

.greeting h2 {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 4px;
    color: #1f2937;
}

.greeting p {
    color: #6b7280;
    font-size: 16px;
}

.notification-btn {
    position: relative;
}

.notification-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #ef4444;
    color: white;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

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

.client-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px -5px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 24px;
    background: rgba(102, 126, 234, 0.2);
    color: #667eea;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 24px;
}

.stat-icon.success {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.stat-icon.warning {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.stat-icon.secondary {
    background: rgba(139, 92, 246, 0.2);
    color: #8b5cf6;
}

.stat-value {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 4px;
    color: #1f2937;
}

.stat-title {
    font-size: 14px;
    color: #6b7280;
}

/* Sections */
.section {
    margin-bottom: 32px;
}

.section h3 {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 16px;
    color: #1f2937;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

/* Quick Actions */
.quick-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.quick-action-card {
    background: white;
    border: none;
    border-radius: 16px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.quick-action-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 25px -5px rgba(0, 0, 0, 0.1);
}

.quick-action-icon {
    width: 40px;
    height: 40px;
    border-radius: 20px;
    background: rgba(102, 126, 234, 0.2);
    color: #667eea;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.quick-action-icon.secondary {
    background: rgba(139, 92, 246, 0.2);
    color: #8b5cf6;
}

.quick-action-icon.success {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.quick-action-content {
    flex: 1;
}

.quick-action-content h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 2px;
    color: #1f2937;
}

.quick-action-content p {
    font-size: 14px;
    color: #6b7280;
}

.quick-action-card i:last-child {
    color: #9ca3af;
    font-size: 16px;
}

/* Activity List */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.activity-item {
    background: white;
    border-radius: 16px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.2s ease;
}

.activity-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 25px -5px rgba(0, 0, 0, 0.1);
}

.activity-avatar {
    width: 48px;
    height: 48px;
    border-radius: 24px;
    background: #e5e7eb;
    object-fit: cover;
}

.activity-content {
    flex: 1;
}

.activity-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 2px;
    color: #1f2937;
}

.activity-status {
    font-size: 14px;
    color: #6b7280;
}

.adherence-indicator {
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
}

/* Motivation Card */
.motivation-card {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(139, 92, 246, 0.2) 100%);
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.motivation-card i {
    font-size: 24px;
    color: #667eea;
}

.motivation-text {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
    color: #1f2937;
}

.motivation-author {
    font-size: 14px;
    font-style: italic;
    color: #6b7280;
}

/* Client Dashboard Specific */
.workout-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.workout-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.workout-header h4 {
    font-size: 18px;
    font-weight: bold;
    color: #1f2937;
}

.workout-duration {
    background: rgba(102, 126, 234, 0.2);
    color: #667eea;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
}

.workout-exercises {
    margin-bottom: 20px;
}

.exercise-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f3f4f6;
}

.exercise-item:last-child {
    border-bottom: none;
}

.exercise-item span:first-child {
    color: #1f2937;
    font-weight: 500;
}

.exercise-item span:last-child {
    color: #6b7280;
    font-weight: 600;
}

.progress-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.progress-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.progress-card h4 {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 16px;
    color: #1f2937;
}

.progress-chart {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 150px;
    background: #f9fafb;
    border-radius: 12px;
}

.streak-display {
    text-align: center;
    padding: 20px;
}

.streak-number {
    display: block;
    font-size: 48px;
    font-weight: bold;
    color: #667eea;
    line-height: 1;
}

.streak-text {
    font-size: 16px;
    color: #6b7280;
    font-weight: 600;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease-out;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 24px 0;
    margin-bottom: 24px;
}

.modal-header h3 {
    font-size: 20px;
    font-weight: bold;
    color: #1f2937;
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 16px;
    border: none;
    background: #f3f4f6;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #e5e7eb;
    color: #374151;
}

.modal-form {
    padding: 0 24px 24px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .dashboard-container {
        padding: 16px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .client-stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .user-type-buttons {
        flex-direction: column;
        gap: 12px;
    }
    
    .user-type-card {
        max-width: none;
    }
    
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .quick-login-buttons {
        flex-direction: column;
        gap: 8px;
    }
    
    .progress-cards {
        grid-template-columns: 1fr;
    }
    
    .navbar {
        padding: 12px 16px;
    }
    
    .nav-brand {
        font-size: 18px;
    }
    
    .modal-content {
        width: 95%;
        margin: 20px;
    }
}

@media (max-width: 480px) {
    .auth-container {
        padding: 20px 16px;
    }
    
    .welcome-content {
        padding: 0 16px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        padding: 16px;
    }
    
    .quick-action-card {
        padding: 12px;
    }
    
    .activity-item {
        padding: 12px;
    }
}