@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg-dark: #070a13;
    --bg-glass: rgba(15, 22, 42, 0.45);
    --border-glass: rgba(255, 255, 255, 0.08);
    --border-focus: rgba(99, 102, 241, 0.5);
    --primary-grad: linear-gradient(135deg, #06b6d4 0%, #6366f1 100%);
    --accent-glow: rgba(6, 182, 212, 0.15);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --card-blur: blur(16px);
    --font-outfit: 'Outfit', sans-serif;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.1) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(6, 182, 212, 0.1) 0px, transparent 50%),
        radial-gradient(at 50% 50%, rgba(124, 58, 237, 0.05) 0px, transparent 60%);
    background-attachment: fixed;
    color: var(--text-main);
    font-family: var(--font-outfit);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    line-height: 1.5;
}

/* Sayfa Konteyneri */
.app-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    flex-grow: 1;
}

/* Glassmorphism Kart */
.glass-card {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    backdrop-filter: var(--card-blur);
    -webkit-backdrop-filter: var(--card-blur);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    margin-bottom: 2rem;
    transition: var(--transition-smooth);
}

.glass-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.5);
}

/* Header & Navigasyon */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.logo-area h1 {
    font-size: 2.2rem;
    font-weight: 800;
    background: var(--primary-grad);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -1px;
}

.logo-area p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-top: 0.2rem;
}

.nav-links {
    display: flex;
    gap: 1rem;
}

.nav-btn {
    text-decoration: none;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    font-weight: 500;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition-smooth);
}

.nav-btn:hover, .nav-btn.active {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.nav-btn.active {
    background: var(--primary-grad);
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.nav-btn.logout-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.3);
    color: #ff8a8a;
}

/* Karşılama Alanı */
.welcome-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.welcome-text h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.welcome-text h2 span {
    background: var(--primary-grad);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.day-badge {
    background: rgba(6, 182, 212, 0.15);
    border: 1px solid rgba(6, 182, 212, 0.3);
    padding: 0.5rem 1.25rem;
    border-radius: 100px;
    font-weight: 600;
    color: #22d3ee;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: pulseGlow 3s infinite alternate;
}

/* Gün Seçim Formu */
.day-selector-form {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.select-wrapper {
    position: relative;
}

.select-wrapper select {
    appearance: none;
    background: rgba(15, 22, 42, 0.8);
    border: 1px solid var(--border-glass);
    padding: 0.6rem 2.5rem 0.6rem 1.2rem;
    border-radius: 12px;
    color: var(--text-main);
    font-family: var(--font-outfit);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    transition: var(--transition-smooth);
}

.select-wrapper select:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.2);
}

.select-wrapper::after {
    content: "▼";
    font-size: 0.8rem;
    color: var(--text-muted);
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

/* Egzersiz Listesi ve Grid Yapısı */
.exercises-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.exercise-card {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 16px;
    padding: 1.5rem;
    transition: var(--transition-smooth);
}

.exercise-card:hover {
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.08);
}

.exercise-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.exercise-title-area h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-main);
}

.exercise-target {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.exercise-target span {
    background: rgba(255, 255, 255, 0.04);
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.exercise-target strong {
    color: var(--text-main);
}

/* Akıllı Öneri Rozeti */
.smart-suggestion {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: #34d399;
    padding: 0.5rem 1rem;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.05);
}

.smart-suggestion.warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

.smart-suggestion.info {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
}

.smart-suggestion .icon {
    font-size: 1.1rem;
}

/* Set Giriş Satırları */
.sets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
}

.set-row {
    background: rgba(15, 22, 42, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    position: relative;
    overflow: hidden;
}

.set-row::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: var(--primary-grad);
}

.set-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.set-inputs {
    display: flex;
    gap: 0.75rem;
}

.input-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

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

.input-group-field {
    position: relative;
    display: flex;
    align-items: center;
}

.input-group-field input {
    width: 100%;
    background: rgba(7, 10, 19, 0.6);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    padding: 0.6rem 1.8rem 0.6rem 0.8rem;
    color: var(--text-main);
    font-family: var(--font-outfit);
    font-size: 1rem;
    font-weight: 600;
    outline: none;
    transition: var(--transition-smooth);
}

.input-group-field input:focus {
    border-color: var(--border-focus);
    background: rgba(7, 10, 19, 0.9);
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.15);
}

/* HTML5 Number Spinner Gizleme */
.input-group-field input::-webkit-outer-spin-button,
.input-group-field input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.input-group-field input[type=number] {
    -moz-appearance: textfield;
}

.input-group-field .unit {
    position: absolute;
    right: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
    pointer-events: none;
}

/* Son Antrenman Bilgi Satırı */
.prev-log-info {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    display: flex;
    justify-content: space-between;
}

.prev-log-info span strong {
    color: var(--text-main);
}

/* Submit Butonu ve Form Altı */
.form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.notes-input-area {
    flex: 1;
    min-width: 280px;
}

.notes-input-area textarea {
    width: 100%;
    background: rgba(7, 10, 19, 0.4);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    color: var(--text-main);
    font-family: var(--font-outfit);
    font-size: 0.95rem;
    outline: none;
    resize: vertical;
    min-height: 80px;
    transition: var(--transition-smooth);
}

.notes-input-area textarea:focus {
    border-color: var(--border-focus);
    background: rgba(7, 10, 19, 0.8);
}

.submit-btn {
    background: var(--primary-grad);
    color: var(--text-main);
    border: none;
    padding: 1rem 2.5rem;
    border-radius: 14px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.35);
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(6, 182, 212, 0.45);
}

.submit-btn:active {
    transform: translateY(0);
}

/* Dinlenme Günü Kartı */
.rest-day-card {
    text-align: center;
    padding: 4rem 2rem;
}

.rest-day-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    animation: floating 3s ease-in-out infinite;
    display: inline-block;
}

.rest-day-card h3 {
    font-size: 1.75rem;
    margin-bottom: 0.75rem;
    font-weight: 700;
}

.rest-day-card p {
    color: var(--text-muted);
    max-width: 500px;
    margin: 0 auto 2rem auto;
}

/* GİRİŞ EKRANI (login.php) */
.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.login-card {
    width: 100%;
    max-width: 420px;
    margin: 1.5rem;
    text-align: center;
}

.login-logo {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.login-card h2 {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: var(--primary-grad);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-card p {
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.login-input-wrapper {
    position: relative;
}

.login-input-wrapper input {
    width: 100%;
    background: rgba(7, 10, 19, 0.6);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 0.9rem 1.2rem;
    color: var(--text-main);
    font-family: var(--font-outfit);
    font-size: 1.05rem;
    font-weight: 500;
    outline: none;
    text-align: center;
    letter-spacing: 2px;
    transition: var(--transition-smooth);
}

.login-input-wrapper input:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.25);
    background: rgba(7, 10, 19, 0.9);
}

.login-btn {
    background: var(--primary-grad);
    color: var(--text-main);
    border: none;
    padding: 0.9rem;
    border-radius: 12px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(6, 182, 212, 0.4);
}

.error-message {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    padding: 0.75rem;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    animation: shake 0.5s ease-in-out;
}

/* GEÇMİŞ SAYFASI (history.php) */
.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.history-item {
    border-left: 4px solid #6366f1;
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    cursor: pointer;
}

.history-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.history-date {
    font-size: 1.15rem;
    font-weight: 700;
}

.history-day {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    padding: 0.25rem 0.75rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
}

.history-actions {
    display: flex;
    gap: 0.5rem;
}

.delete-btn {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition-smooth);
}

.delete-btn:hover {
    background: rgba(239, 68, 68, 0.3);
    border-color: rgba(239, 68, 68, 0.5);
    color: #ffffff;
}

.history-notes {
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid var(--border-glass);
    padding: 1rem 1.5rem;
    margin-top: 1rem;
    border-radius: 8px;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.history-notes strong {
    color: var(--text-main);
    display: block;
    margin-bottom: 0.25rem;
}

/* Geçmiş Tablosu */
.history-table-wrapper {
    overflow-x: auto;
    margin-top: 1rem;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.95rem;
}

.history-table th {
    color: var(--text-muted);
    font-weight: 600;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-glass);
}

.history-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

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

.history-table .set-badge {
    background: rgba(63, 94, 251, 0.15);
    color: #818cf8;
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.8rem;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

/* Egzersiz Grubu Kartları */
.exercise-group {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.exercise-group h4 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #22d3ee;
}

/* GRAFİK BÖLÜMÜ */
.chart-container {
    height: 350px;
    position: relative;
    margin-top: 1rem;
}

/* Altlık (Footer) */
footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    border-top: 1px solid var(--border-glass);
    margin-top: auto;
}

footer a {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 500;
}

footer a:hover {
    text-decoration: underline;
}

/* ANIMASYONLAR */
@keyframes pulseGlow {
    0% {
        box-shadow: 0 0 10px rgba(6, 182, 212, 0.1);
    }
    100% {
        box-shadow: 0 0 20px rgba(6, 182, 212, 0.3);
    }
}

@keyframes floating {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

/* RESPONSIVE AYARLAR */
@media (max-width: 768px) {
    .app-container {
        padding: 1rem;
    }
    
    header {
        margin-bottom: 2rem;
        flex-direction: column;
        align-items: flex-start;
    }
    
    .nav-links {
        width: 100%;
    }
    
    .nav-btn {
        flex: 1;
        justify-content: center;
        padding: 0.6rem 0.8rem;
        font-size: 0.85rem;
    }
    
    .logo-area h1 {
        font-size: 1.8rem;
    }
    
    .welcome-banner {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .day-selector-form {
        width: 100%;
    }
    
    .select-wrapper {
        flex-grow: 1;
    }
    
    .select-wrapper select {
        width: 100%;
    }
    
    .glass-card {
        padding: 1.25rem;
        border-radius: 16px;
    }
    
    .exercise-card {
        padding: 1rem;
    }
    
    .exercise-header {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .smart-suggestion {
        width: 100%;
        justify-content: center;
    }
    
    .sets-grid {
        grid-template-columns: 1fr;
    }
    
    .set-row {
        padding: 0.85rem;
    }
    
    .set-inputs {
        gap: 0.5rem;
    }
    
    .input-group-field input {
        padding: 0.5rem 1.6rem 0.5rem 0.6rem;
        font-size: 0.95rem;
    }
    
    .form-footer {
        flex-direction: column;
        align-items: stretch;
    }
    
    .submit-btn {
        width: 100%;
        justify-content: center;
    }
    
    .history-item-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .history-meta {
        flex-wrap: wrap;
        gap: 0.5rem;
        width: 100%;
    }
    
    .history-table {
        font-size: 0.85rem;
    }
    
    .history-table th, .history-table td {
        padding: 0.5rem 0.6rem;
    }
    
    .history-actions {
        width: 100%;
        justify-content: space-between;
    }
}

/* Drop Set ve Buton Arayüz Tanımları */
.btn-add-drop {
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.25);
    color: #fbbf24;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    outline: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.btn-add-drop:hover {
    background: rgba(245, 158, 11, 0.25);
    border-color: #fbbf24;
    color: #ffffff;
    transform: translateY(-1px);
}

.drop-set-row {
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
