/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #1a1a1a;
    color: #ffffff;
    overflow: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header styles */
.main-header {
    background-color: #2c3e50;
    padding: 10px 20px;
    border-bottom: 2px solid #34495e;
    flex-shrink: 0;
}

.main-header nav {
    display: flex;
    gap: 20px;
}

.nav-link {
    color: #bdc3c7;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: bold;
    padding: 5px 10px;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.nav-link:hover, .nav-link.active {
    color: #ecf0f1;
    background-color: #34495e;
}

/* Main app container - split screen layout */
.app-container {
    display: flex;
    flex: 1;
    width: 100vw;
    overflow: hidden;
}

/* Steps Page specific styles */
.steps-container {
    background-color: #f8f9fa; /* White/Light background */
    color: #2c3e50;
    padding: 30px;
    overflow-y: auto;
    width: 100%;
    height: 100%;
}

.steps-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid #dee2e6;
}

.steps-header h1 {
    color: #2c3e50;
    font-size: 2rem;
    text-shadow: none;
    margin: 0;
}

.btn-refresh {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-refresh:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.btn-refresh:disabled {
    background: #95a5a6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

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

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    border: 1px solid #e9ecef;
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-title {
    font-size: 0.9rem;
    color: #7f8c8d;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: #2c3e50;
}

.stat-trend {
    font-size: 0.9rem;
    margin-top: 5px;
}

.trend-up { color: #2ecc71; }
.trend-down { color: #e74c3c; }

/* Data Table */
.data-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    border: 1px solid #e9ecef;
    overflow: hidden;
}

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

.steps-table thead {
    background-color: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
}

.steps-table th {
    padding: 16px 24px;
    text-align: left;
    font-weight: 600;
    color: #7f8c8d;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.steps-table td {
    padding: 16px 24px;
    border-bottom: 1px solid #e9ecef;
    color: #2c3e50;
}

.steps-table tr:last-child td {
    border-bottom: none;
}

.steps-table tr:hover {
    background-color: #f8f9fa;
}

.step-count {
    font-weight: 700;
    color: #2c3e50;
}

.points-badge {
    background-color: #fff3cd;
    color: #856404;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.9rem;
}

/* Left panel - Exercise management */
.exercise-panel {
    width: 40%;
    background: linear-gradient(135deg, #2c3e50, #34495e);
    padding: 20px;
    overflow-y: auto;
    border-right: 2px solid #34495e;
}

.panel-header {
    margin-bottom: 20px;
    text-align: center;
}

.panel-header h1 {
    color: #ecf0f1;
    font-size: 2.5rem;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.workout-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.workout-selector select {
    flex: 1;
    padding: 12px;
    font-size: 1.1rem;
    border: none;
    border-radius: 8px;
    background-color: #34495e;
    color: white;
    cursor: pointer;
}

.workout-info {
    background: rgba(52, 73, 94, 0.8);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 1px solid #34495e;
}

.workout-info h2 {
    color: #3498db;
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.workout-info p {
    color: #bdc3c7;
    margin-bottom: 15px;
}

.progress-bar {
    position: relative;
    background-color: #2c3e50;
    height: 20px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #34495e;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #27ae60, #2ecc71);
    transition: width 0.3s ease;
    border-radius: 10px;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.7);
}

/* Exercise list */
.exercise-list {
    margin-bottom: 20px;
}

.exercise-item {
    background: rgba(44, 62, 80, 0.8);
    margin-bottom: 15px;
    padding: 15px;
    border-radius: 10px;
    border: 1px solid #34495e;
    transition: all 0.3s ease;
}

.exercise-item:hover {
    background: rgba(52, 73, 94, 0.9);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.exercise-item.completed {
    background: rgba(39, 174, 96, 0.2);
    border-color: #27ae60;
}

.exercise-content {
    cursor: pointer;
}

.exercise-content:hover {
    opacity: 0.8;
}

.exercise-content h3 {
    color: #ecf0f1;
    font-size: 1.3rem;
    margin-bottom: 8px;
}

.exercise-notes {
    color: #bdc3c7;
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.exercise-duration {
    color: #3498db;
    font-weight: bold;
    font-size: 1.1rem;
}

.exercise-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

/* Exercise video section */
.video-drop-zone {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-drop-zone:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.video-drop-zone.drag-over {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    transform: scale(1.05);
}

.drop-text {
    font-size: 1.5rem;
    line-height: 1;
}

.upload-progress {
    color: #f39c12;
    font-size: 0.9rem;
    font-weight: bold;
}

.progress-bar-small {
    width: 100%;
    height: 4px;
    background-color: #2c3e50;
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}

.progress-fill-small {
    height: 100%;
    background: linear-gradient(90deg, #f39c12, #e67e22);
    width: 0%;
    transition: width 0.3s ease;
    animation: pulse 1.5s infinite;
}

.exercise-video-player {
    background: rgba(44, 62, 80, 0.8);
    border-radius: 8px;
    padding: 10px;
    border: 1px solid #34495e;
}

.exercise-video-player video {
    border-radius: 4px;
    background: #000;
}

.btn-remove-video {
    margin-top: 8px;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    font-size: 0.8rem;
    padding: 6px 12px;
}


/* Right panel - Video player */
.video-panel {
    width: 60%;
    background: #000;
    display: flex;
    flex-direction: column;
    position: relative;
}

.video-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

#workout-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

.video-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    z-index: 10;
}

/* Buttons */
.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.btn-primary {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}

.btn-secondary {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
}

.btn-complete {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    font-size: 0.9rem;
    padding: 8px 16px;
}

.btn-timer {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
    font-size: 0.9rem;
    padding: 8px 16px;
    transition: all 0.3s ease;
}

.btn-timer.timer-running {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    animation: pulse 1s infinite;
    font-size: 1rem;
    font-weight: bold;
    padding: 12px 20px;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.btn-small {
    padding: 8px 12px;
    font-size: 0.8rem;
    background: rgba(52, 152, 219, 0.8);
    color: white;
    border: 1px solid #3498db;
}

.btn-small:hover {
    background: rgba(52, 152, 219, 1);
}

/* iPad specific optimizations */
@media (max-width: 1024px) {
    .exercise-panel {
        width: 45%;
        padding: 15px;
    }
    
    .video-panel {
        width: 55%;
    }
    
    .panel-header h1 {
        font-size: 2rem;
    }
    
    .btn {
        padding: 10px 16px;
        font-size: 0.9rem;
    }
    
    .exercise-actions {
        flex-direction: column;
        gap: 8px;
    }
}

/* Touch optimizations */
@media (hover: none) and (pointer: coarse) {
    .btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .exercise-item {
        padding: 20px;
    }
    
    .timer-circle {
        width: 140px;
        height: 140px;
    }
    
    #timer-text {
        font-size: 2.2rem;
    }
}

/* Scrollbar styling */
.exercise-panel::-webkit-scrollbar {
    width: 8px;
}

.exercise-panel::-webkit-scrollbar-track {
    background: #2c3e50;
}

.exercise-panel::-webkit-scrollbar-thumb {
    background: #34495e;
    border-radius: 4px;
}

.exercise-panel::-webkit-scrollbar-thumb:hover {
    background: #3498db;
}

/* Mobile header optimizations */
@media (max-width: 768px) {
    .brand-title {
        display: none !important;
    }

    .user-name {
        display: none !important;
    }

    .logout-link::before {
        content: '👋';
        font-size: 1.2rem;
    }

    .logout-link {
        font-size: 0 !important;
        padding: 5px 0 !important;
    }

    .main-header nav {
        gap: 10px !important;
    }

    .nav-links {
        margin-left: 0 !important;
        display: flex;
        gap: 10px;
    }
}
