/**
 * AsT Gym Tracker - Frontend Styles
 * Modern, mobil uyumlu, koyu tema
 */

/* CSS Variables */
:root {
    --ast-primary: #06b6d4;
    --ast-primary-hover: #0891b2;
    --ast-secondary: #8b5cf6;
    --ast-success: #10b981;
    --ast-warning: #f59e0b;
    --ast-danger: #ef4444;
    --ast-dark: #0f172a;
    --ast-card: #1e293b;
    --ast-card-hover: #334155;
    --ast-border: #334155;
    --ast-text: #f1f5f9;
    --ast-muted: #94a3b8;
    --ast-radius: 12px;
    --ast-radius-sm: 8px;
    --ast-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --ast-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
}

/* Reset & Base */
.ast-gym-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--ast-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.ast-gym-wrapper * {
    box-sizing: border-box;
}

.ast-gym-wrapper a {
    color: var(--ast-primary);
    text-decoration: none;
}

.ast-gym-wrapper a:hover {
    color: var(--ast-primary-hover);
}

/* Container */
.ast-gym-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    background: var(--ast-dark);
    min-height: 100vh;
}

/* Header */
.ast-gym-header {
    background: linear-gradient(135deg, var(--ast-card) 0%, #0f172a 100%);
    border-radius: var(--ast-radius);
    padding: 24px;
    margin-bottom: 24px;
    border: 1px solid var(--ast-border);
    position: relative;
    overflow: hidden;
}

.ast-gym-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 200px;
    height: 200px;
    background: var(--ast-primary);
    opacity: 0.05;
    border-radius: 50%;
}

.ast-gym-header-badge {
    display: inline-block;
    background: rgba(6, 182, 212, 0.15);
    color: var(--ast-primary);
    font-size: 11px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.ast-gym-header h1 {
    font-size: 28px;
    font-weight: 800;
    margin: 0 0 8px 0;
    color: white;
}

.ast-gym-header p {
    color: var(--ast-muted);
    margin: 0;
    font-size: 15px;
}

.ast-gym-header-stats {
    display: flex;
    gap: 16px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.ast-gym-header-stat {
    background: rgba(255, 255, 255, 0.05);
    padding: 8px 16px;
    border-radius: var(--ast-radius-sm);
    font-size: 13px;
}

.ast-gym-header-stat strong {
    color: var(--ast-primary);
}

/* Navigation Tabs */
.ast-gym-tabs {
    display: flex;
    gap: 4px;
    background: var(--ast-card);
    padding: 4px;
    border-radius: var(--ast-radius);
    margin-bottom: 24px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.ast-gym-tab {
    flex: 1;
    min-width: 100px;
    padding: 12px 16px;
    background: transparent;
    border: none;
    color: var(--ast-muted);
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--ast-radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.ast-gym-tab:hover {
    color: var(--ast-text);
    background: rgba(255, 255, 255, 0.05);
}

.ast-gym-tab.active {
    background: var(--ast-primary);
    color: white;
}

/* Cards */
.ast-gym-card {
    background: var(--ast-card);
    border-radius: var(--ast-radius);
    border: 1px solid var(--ast-border);
    margin-bottom: 16px;
    overflow: hidden;
}

.ast-gym-card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--ast-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ast-gym-card-header h2,
.ast-gym-card-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.ast-gym-card-body {
    padding: 20px;
}

/* Critical Rules Box */
.ast-gym-critical-box {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(239, 68, 68, 0.05) 100%);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--ast-radius);
    padding: 20px;
    margin-bottom: 24px;
}

.ast-gym-critical-box h3 {
    color: #f87171;
    margin: 0 0 16px 0;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ast-gym-critical-list {
    display: grid;
    gap: 12px;
}

.ast-gym-critical-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: rgba(0, 0, 0, 0.2);
    padding: 12px;
    border-radius: var(--ast-radius-sm);
}

.ast-gym-critical-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.ast-gym-critical-content strong {
    display: block;
    color: white;
    margin-bottom: 2px;
}

.ast-gym-critical-content span {
    font-size: 13px;
    color: var(--ast-muted);
}

/* Day Cards */
.ast-gym-day {
    background: var(--ast-card);
    border-radius: var(--ast-radius);
    border: 1px solid var(--ast-border);
    margin-bottom: 16px;
    transition: all 0.2s ease;
}

.ast-gym-day:hover {
    border-color: var(--ast-primary);
    transform: translateY(-2px);
    box-shadow: var(--ast-shadow-lg);
}

.ast-gym-day-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--ast-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.ast-gym-day-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--ast-primary);
}

.ast-gym-day-focus {
    font-size: 12px;
    color: var(--ast-muted);
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 10px;
    border-radius: 20px;
}

.ast-gym-day-toggle {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    color: var(--ast-muted);
    transition: all 0.2s ease;
}

.ast-gym-day.expanded .ast-gym-day-toggle {
    transform: rotate(180deg);
    background: var(--ast-primary);
    color: white;
}

.ast-gym-day-content {
    display: none;
    padding: 20px;
}

.ast-gym-day.expanded .ast-gym-day-content {
    display: block;
}

/* Exercise Table */
.ast-gym-exercises {
    width: 100%;
    border-collapse: collapse;
}

.ast-gym-exercises th {
    text-align: left;
    padding: 10px 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--ast-muted);
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--ast-border);
}

.ast-gym-exercises td {
    padding: 12px;
    border-bottom: 1px solid var(--ast-border);
    font-size: 14px;
}

.ast-gym-exercises tr:last-child td {
    border-bottom: none;
}

.ast-gym-exercises tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.ast-gym-exercise-name {
    font-weight: 500;
    color: white;
}

.ast-gym-exercise-tip {
    font-size: 12px;
    color: var(--ast-muted);
    margin-top: 4px;
    font-style: italic;
}

.ast-gym-exercise-note {
    display: inline-block;
    font-size: 11px;
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    padding: 2px 8px;
    border-radius: 4px;
    margin-top: 4px;
}

/* Log Form */
.ast-gym-log-form {
    background: var(--ast-card);
    border-radius: var(--ast-radius);
    padding: 20px;
    margin-bottom: 16px;
}

.ast-gym-log-exercise {
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--ast-radius-sm);
    padding: 16px;
    margin-bottom: 12px;
}

.ast-gym-log-exercise-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.ast-gym-log-exercise-name {
    font-weight: 600;
    color: white;
}

.ast-gym-log-exercise-target {
    font-size: 12px;
    color: var(--ast-muted);
    background: var(--ast-card);
    padding: 4px 10px;
    border-radius: 4px;
}

.ast-gym-log-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.ast-gym-input-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ast-gym-input-group label {
    font-size: 11px;
    color: var(--ast-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ast-gym-input-group input {
    background: var(--ast-card);
    border: 1px solid var(--ast-border);
    border-radius: var(--ast-radius-sm);
    padding: 10px 12px;
    color: white;
    font-size: 16px;
    text-align: center;
    transition: all 0.2s ease;
}

.ast-gym-input-group input:focus {
    outline: none;
    border-color: var(--ast-primary);
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.15);
}

/* Buttons */
.ast-gym-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: var(--ast-radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.ast-gym-btn-primary {
    background: var(--ast-primary);
    color: white;
}

.ast-gym-btn-primary:hover {
    background: var(--ast-primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--ast-shadow);
}

.ast-gym-btn-success {
    background: var(--ast-success);
    color: white;
}

.ast-gym-btn-success:hover {
    background: #059669;
}

.ast-gym-btn-secondary {
    background: var(--ast-card);
    color: var(--ast-text);
    border: 1px solid var(--ast-border);
}

.ast-gym-btn-secondary:hover {
    background: var(--ast-card-hover);
}

.ast-gym-btn-block {
    width: 100%;
}

.ast-gym-btn-lg {
    padding: 16px 32px;
    font-size: 16px;
}

/* History */
.ast-gym-history-item {
    background: var(--ast-card);
    border-radius: var(--ast-radius);
    border: 1px solid var(--ast-border);
    margin-bottom: 12px;
    overflow: hidden;
}

.ast-gym-history-header {
    padding: 16px;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--ast-border);
}

.ast-gym-history-day {
    font-weight: 600;
    color: white;
}

.ast-gym-history-date {
    font-size: 13px;
    color: var(--ast-primary);
}

.ast-gym-history-exercises {
    padding: 16px;
}

.ast-gym-history-exercise {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--ast-border);
    font-size: 14px;
}

.ast-gym-history-exercise:last-child {
    border-bottom: none;
}

.ast-gym-history-exercise-name {
    color: var(--ast-muted);
}

.ast-gym-history-exercise-data {
    font-weight: 500;
    color: white;
}

/* Nutrition Section */
.ast-gym-nutrition {
    display: grid;
    gap: 16px;
}

.ast-gym-meal {
    display: flex;
    gap: 16px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--ast-radius-sm);
}

.ast-gym-meal-time {
    min-width: 60px;
    font-weight: 700;
    color: var(--ast-primary);
}

.ast-gym-meal-name {
    font-weight: 500;
    color: white;
    margin-bottom: 2px;
}

.ast-gym-meal-content {
    font-size: 13px;
    color: var(--ast-muted);
}

/* Macros */
.ast-gym-macros {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.ast-gym-macro {
    background: rgba(0, 0, 0, 0.2);
    padding: 16px;
    border-radius: var(--ast-radius-sm);
    text-align: center;
}

.ast-gym-macro-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--ast-primary);
}

.ast-gym-macro-label {
    font-size: 11px;
    color: var(--ast-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

/* Phases */
.ast-gym-phases {
    display: grid;
    gap: 16px;
}

.ast-gym-phase {
    display: flex;
    gap: 16px;
    padding-left: 20px;
    border-left: 3px solid var(--ast-primary);
}

.ast-gym-phase:nth-child(2) {
    border-color: var(--ast-success);
}

.ast-gym-phase:nth-child(3) {
    border-color: var(--ast-warning);
}

.ast-gym-phase-weeks {
    min-width: 80px;
    font-weight: 700;
    color: var(--ast-primary);
}

.ast-gym-phase-name {
    font-weight: 600;
    color: white;
    margin-bottom: 4px;
}

.ast-gym-phase-focus {
    font-size: 13px;
    color: var(--ast-muted);
}

/* Profile Form */
.ast-gym-profile-form {
    display: grid;
    gap: 16px;
}

.ast-gym-form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.ast-gym-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ast-gym-form-group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--ast-muted);
}

.ast-gym-form-group input,
.ast-gym-form-group select,
.ast-gym-form-group textarea {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--ast-border);
    border-radius: var(--ast-radius-sm);
    padding: 12px;
    color: white;
    font-size: 15px;
}

.ast-gym-form-group input:focus,
.ast-gym-form-group select:focus,
.ast-gym-form-group textarea:focus {
    outline: none;
    border-color: var(--ast-primary);
}

/* Stats Display */
.ast-gym-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.ast-gym-stat-card {
    background: var(--ast-card);
    border-radius: var(--ast-radius);
    padding: 20px;
    text-align: center;
    border: 1px solid var(--ast-border);
}

.ast-gym-stat-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--ast-primary);
}

.ast-gym-stat-label {
    font-size: 12px;
    color: var(--ast-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

/* Alert Boxes */
.ast-gym-alert {
    padding: 16px;
    border-radius: var(--ast-radius-sm);
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.ast-gym-alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #fbbf24;
}

.ast-gym-alert-info {
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid rgba(6, 182, 212, 0.3);
    color: var(--ast-primary);
}

.ast-gym-alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--ast-success);
}

/* Login Required */
.ast-gym-login-required {
    text-align: center;
    padding: 60px 20px;
    background: var(--ast-card);
    border-radius: var(--ast-radius);
}

.ast-gym-login-required h2 {
    margin: 0 0 12px 0;
    font-size: 24px;
}

.ast-gym-login-required p {
    color: var(--ast-muted);
    margin-bottom: 24px;
}

/* Empty State */
.ast-gym-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--ast-muted);
}

.ast-gym-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* Loading */
.ast-gym-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--ast-muted);
}

.ast-gym-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--ast-border);
    border-top-color: var(--ast-primary);
    border-radius: 50%;
    animation: ast-spin 0.8s linear infinite;
    margin-right: 12px;
}

@keyframes ast-spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .ast-gym-container {
        padding: 12px;
    }
    
    .ast-gym-header h1 {
        font-size: 22px;
    }
    
    .ast-gym-tabs {
        flex-wrap: nowrap;
    }
    
    .ast-gym-tab {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .ast-gym-macros {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .ast-gym-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .ast-gym-form-row {
        grid-template-columns: 1fr;
    }
    
    .ast-gym-exercises {
        font-size: 13px;
    }
    
    .ast-gym-exercises th,
    .ast-gym-exercises td {
        padding: 8px;
    }
    
    .ast-gym-day-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .ast-gym-day-focus {
        align-self: flex-start;
    }
}

/* Print */
@media print {
    .ast-gym-wrapper {
        background: white;
        color: black;
    }
    
    .ast-gym-tabs,
    .ast-gym-btn {
        display: none;
    }
    
    .ast-gym-day-content {
        display: block !important;
    }
}

/* Animations */
@keyframes ast-fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.ast-gym-animate-in {
    animation: ast-fadeIn 0.3s ease;
}
