/* =============================================
   URTIM Akademi - Main Stylesheet
   Variables, Reset, Typography, Base Styles
   ============================================= */

/* ---- CSS Variables (Design Tokens) ---- */
:root {
    /* Brand Colors */
    --primary: #0098DA;
    --primary-dark: #0077B6;
    --primary-darker: #005F8A;
    --primary-light: #4FC3F7;
    --primary-lighter: #E1F5FE;
    --primary-50: #F0F9FF;

    /* Accent Colors */
    --accent: #FF6B35;
    --accent-light: #FF8A5C;
    --accent-dark: #E55A25;
    --accent-50: #FFF3ED;

    /* Secondary */
    --secondary: #7B8794;
    --secondary-light: #A0ADB8;
    --secondary-dark: #5A6577;

    /* Status Colors */
    --success: #00C853;
    --success-light: #E8F5E9;
    --warning: #FFB300;
    --warning-light: #FFF8E1;
    --danger: #FF3D00;
    --danger-light: #FBE9E7;

    /* Surfaces & Backgrounds */
    --bg: #F5F9FC;
    --bg-alt: #EEF4F8;
    --bg-gradient: linear-gradient(180deg, #F0F9FF 0%, #F5F9FC 50%, #FFFFFF 100%);
    --surface: #FFFFFF;
    --surface-hover: #FAFCFE;
    --surface-elevated: #FFFFFF;

    /* Text */
    --text: #1A2332;
    --text-secondary: #5A6577;
    --text-light: #8E9AAF;
    --text-inverse: #FFFFFF;

    /* Borders */
    --border: #E2E8F0;
    --border-light: #F0F4F8;
    --border-focus: var(--primary);

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #0098DA 0%, #0077B6 100%);
    --gradient-primary-light: linear-gradient(135deg, #4FC3F7 0%, #0098DA 100%);
    --gradient-accent: linear-gradient(135deg, #FF6B35 0%, #FF8A5C 100%);
    --gradient-hero: linear-gradient(135deg, rgba(0, 152, 218, 0.92) 0%, rgba(0, 119, 182, 0.88) 50%, rgba(0, 95, 138, 0.85) 100%);
    --gradient-dark: linear-gradient(135deg, #1A2332 0%, #2D3748 100%);
    --gradient-glass: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.85) 100%);

    /* Shadows */
    --shadow-xs: 0 1px 3px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 6px 24px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.16);
    --shadow-primary: 0 4px 16px rgba(0, 152, 218, 0.3);
    --shadow-accent: 0 4px 16px rgba(255, 107, 53, 0.3);
    --shadow-glow: 0 0 40px rgba(0, 152, 218, 0.15);

    /* Radius */
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Transitions */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-out: cubic-bezier(0, 0, 0.2, 1);
    --transition-fast: all 0.15s var(--ease);
    --transition: all 0.3s var(--ease);
    --transition-slow: all 0.5s var(--ease);
    --transition-bounce: all 0.4s var(--ease-bounce);

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-display: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    --space-3xl: 64px;
    --space-4xl: 96px;

    /* Layout */
    --container-max: 1280px;
    --container-narrow: 960px;
    --navbar-height: 72px;

    /* Z-index layers */
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-modal-backdrop: 900;
    --z-modal: 1000;
    --z-toast: 1100;
}

/* ---- Language-specific content visibility ---- */
/* Controls [data-lang-only="tr/en"] blocks based on the html[lang] attribute.
   i18n.setLanguage() updates document.documentElement.lang which triggers these rules. */
html[lang="tr"] [data-lang-only="en"] { display: none !important; }
html[lang="en"] [data-lang-only="tr"] { display: none !important; }

/* ---- CSS Reset ---- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    font-size: 16px;
}

/* ---- Accessibility ---- */
.skip-link {
    position: absolute;
    top: -100%;
    left: 16px;
    background: var(--primary);
    color: #fff;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    z-index: 100000;
    font-weight: 600;
    text-decoration: none;
    transition: top 0.2s;
}
.skip-link:focus {
    top: 8px;
}
.keyboard-navigation *:focus {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
}
.keyboard-navigation *:focus:not(:focus-visible) {
    outline: none;
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

body {
    font-family: var(--font-family);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text);
    background-color: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    min-height: 100vh;
}

body.modal-open {
    overflow: hidden;
}

img,
svg {
    display: block;
    max-width: 100%;
    height: auto;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition-fast);
}

a:hover {
    color: var(--primary-dark);
}

ul, ol {
    list-style: none;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

input,
textarea,
select {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    outline: none;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.2;
    color: var(--text);
}

/* ---- Typography Scale ---- */
.text-hero {
    font-size: clamp(2.2rem, 5vw, 3.5rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.text-h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    letter-spacing: -0.02em;
}

.text-h2 {
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    font-weight: 700;
    letter-spacing: -0.01em;
}

.text-h3 {
    font-size: clamp(1.25rem, 2.5vw, 1.75rem);
    font-weight: 600;
}

.text-h4 {
    font-size: clamp(1.1rem, 2vw, 1.35rem);
    font-weight: 600;
}

.text-body {
    font-size: 1rem;
    line-height: 1.7;
}

.text-sm {
    font-size: 0.875rem;
    line-height: 1.5;
}

.text-xs {
    font-size: 0.75rem;
    line-height: 1.4;
}

/* ---- Layout Helpers ---- */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.container-narrow {
    max-width: var(--container-narrow);
}

.section {
    padding: var(--space-4xl) 0;
    position: relative;
}

.section-alt {
    background-color: var(--bg-alt);
}

.section-white {
    background-color: var(--surface);
}

/* ---- Badge ---- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    border-radius: var(--radius-full);
    background: var(--primary-lighter);
    color: var(--primary-dark);
    margin-bottom: var(--space-md);
}

.badge i {
    font-size: 0.75rem;
}

/* ---- Section Header ---- */
.section-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto var(--space-3xl);
}

.section-header .badge {
    margin-bottom: var(--space-md);
}

.section-header h2 {
    margin-bottom: var(--space-md);
}

.section-header p {
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.7;
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: var(--radius);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    letter-spacing: 0.01em;
}

.btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, transparent 50%);
    opacity: 0;
    transition: var(--transition);
}

.btn:hover::before {
    opacity: 1;
}

.btn-primary {
    background: var(--gradient-primary);
    color: var(--text-inverse);
    box-shadow: var(--shadow-primary);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0, 152, 218, 0.4);
    color: var(--text-inverse);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-accent {
    background: var(--gradient-accent);
    color: var(--text-inverse);
    box-shadow: var(--shadow-accent);
}

.btn-accent:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(255, 107, 53, 0.4);
    color: var(--text-inverse);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: var(--text-inverse);
    transform: translateY(-2px);
    box-shadow: var(--shadow-primary);
}

.btn-white {
    background: var(--surface);
    color: var(--primary-dark);
    box-shadow: var(--shadow-sm);
}

.btn-white:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    color: var(--primary-dark);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: var(--bg-alt);
    color: var(--primary);
}

.btn-lg {
    padding: 16px 36px;
    font-size: 1.05rem;
    border-radius: var(--radius-lg);
}

.btn-sm {
    padding: 8px 18px;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
}

.btn-icon {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: var(--radius);
}

/* Ripple effect */
.btn .ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
    transform: scale(0);
    animation: ripple 0.6s ease-out;
    pointer-events: none;
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* ---- Cards ---- */
.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: var(--space-xl);
    transition: var(--transition);
    border: 1px solid var(--border-light);
    position: relative;
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
    border-color: var(--primary-lighter);
}

.card-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    background: var(--primary-lighter);
    color: var(--primary);
    font-size: 1.4rem;
    margin-bottom: var(--space-md);
    transition: var(--transition);
}

.card:hover .card-icon {
    background: var(--gradient-primary);
    color: var(--text-inverse);
    transform: scale(1.1) rotate(-5deg);
}

.card h3 {
    margin-bottom: var(--space-sm);
    font-size: 1.15rem;
}

.card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.65;
}

/* ---- Form Inputs ---- */
.form-group {
    margin-bottom: var(--space-lg);
    position: relative;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    transition: var(--transition);
    font-size: 0.95rem;
}

.form-input:hover {
    border-color: var(--secondary-light);
}

.form-input:focus {
    border-color: var(--primary);
    background: var(--surface);
    box-shadow: 0 0 0 4px rgba(0, 152, 218, 0.1);
}

.form-input::placeholder {
    color: var(--text-light);
}

.form-input.error {
    border-color: var(--danger);
    box-shadow: 0 0 0 4px rgba(255, 61, 0, 0.1);
}

.form-select {
    appearance: none;
    padding-right: 40px;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%237B8794' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 20px;
    cursor: pointer;
}

textarea.form-input {
    resize: vertical;
    min-height: 120px;
}

.form-helper {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 4px;
}

.form-error {
    font-size: 0.8rem;
    color: var(--danger);
    margin-top: 6px;
    display: none;
    width: 100%;
    line-height: 1.4;
    font-weight: 500;
}

.form-group > .form-error {
    display: none;
}

/* ---- Input Icon Prefix ---- */
.input-icon-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon-wrapper .form-input {
    padding-left: 44px;
}

.input-icon-wrapper .form-input.has-suffix {
    padding-right: 44px;
}

/* When wrapper only has a password toggle (no left icon), reset left padding and add right padding */
.input-icon-wrapper:not(:has(> i:first-of-type)) .form-input {
    padding-left: var(--space-md);
    padding-right: 44px;
}

.input-icon-wrapper > i:first-of-type {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 1rem;
    transition: var(--transition);
    pointer-events: none;
    z-index: 1;
}

.input-icon-wrapper .form-input:focus ~ i:first-of-type,
.input-icon-wrapper .form-input:focus + i:first-of-type {
    color: var(--primary);
}

/* Password toggle suffix icon */
.input-icon-wrapper .password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    cursor: pointer;
    padding: 4px;
    transition: var(--transition);
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
}

.input-icon-wrapper .password-toggle:hover {
    color: var(--primary);
}

.input-icon-wrapper .password-toggle i {
    position: static;
    transform: none;
    pointer-events: none;
    font-size: 0.95rem;
}

/* ---- Divider ---- */
.divider {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin: var(--space-lg) 0;
    color: var(--text-light);
    font-size: 0.85rem;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ---- Floating Accent Shapes ---- */
.floating-shapes {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.floating-shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.06;
    animation: float-gentle 20s ease-in-out infinite;
}

.floating-shape:nth-child(1) {
    width: 300px;
    height: 300px;
    background: var(--primary);
    top: -100px;
    right: -50px;
    animation-delay: 0s;
}

.floating-shape:nth-child(2) {
    width: 200px;
    height: 200px;
    background: var(--accent);
    bottom: -80px;
    left: -40px;
    animation-delay: -7s;
}

.floating-shape:nth-child(3) {
    width: 150px;
    height: 150px;
    background: var(--primary-light);
    top: 50%;
    left: 60%;
    animation-delay: -14s;
}

@keyframes float-gentle {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(20px, -30px) rotate(5deg); }
    50% { transform: translate(-15px, 20px) rotate(-3deg); }
    75% { transform: translate(10px, -10px) rotate(2deg); }
}

/* ---- Tag/Chip ---- */
.tag {
    display: inline-block;
    padding: 4px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    background: var(--primary-lighter);
    color: var(--primary-dark);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.tag-accent {
    background: var(--accent-50);
    color: var(--accent-dark);
}

.tag-success {
    background: var(--success-light);
    color: #1B5E20;
}

/* ---- Tooltip ---- */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-4px);
    padding: 6px 12px;
    background: var(--text);
    color: var(--text-inverse);
    font-size: 0.75rem;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
}

[data-tooltip]:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(-8px);
}

/* ---- Skeleton Loader ---- */
.skeleton {
    background: linear-gradient(90deg, var(--bg-alt) 25%, var(--border-light) 50%, var(--bg-alt) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: var(--radius);
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-light);
}

/* ---- Selection ---- */
::selection {
    background: rgba(0, 152, 218, 0.2);
    color: var(--text);
}

/* ---- Toast Notifications ---- */
.toast-container {
    position: fixed;
    bottom: var(--space-xl);
    right: var(--space-xl);
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column-reverse;
    gap: var(--space-sm);
    max-width: 400px;
}
.toast {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-lg);
    background: var(--surface);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-lg);
    font-size: 0.88rem;
    color: var(--text);
    animation: toastIn 0.3s ease;
    position: relative;
    overflow: hidden;
    min-width: 280px;
}
.toast--removing { animation: toastOut 0.3s ease forwards; }
.toast-icon { font-size: 1rem; flex-shrink: 0; line-height: 1.4; }
.toast-body { flex: 1; line-height: 1.4; }
.toast-close {
    background: none; border: none;
    color: var(--text-light); cursor: pointer;
    font-size: 0.85rem; padding: 2px;
    opacity: 0.5; transition: opacity 0.2s;
}
.toast-close:hover { opacity: 1; }
.toast-progress {
    position: absolute; bottom: 0; left: 0;
    height: 3px; border-radius: 0 0 0 var(--radius-lg);
}
.toast--success .toast-icon { color: var(--success); }
.toast--success .toast-progress { background: var(--success); }
.toast--error .toast-icon { color: var(--danger); }
.toast--error .toast-progress { background: var(--danger); }
.toast--warning .toast-icon { color: var(--warning); }
.toast--warning .toast-progress { background: var(--warning); }
.toast--info .toast-icon { color: var(--primary); }
.toast--info .toast-progress { background: var(--primary); }

@keyframes toastIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
@keyframes toastOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}
