:root {
    --primary: #ff6b35;
    --primary-dark: #e85a2a;
    --primary-light: #ff8456;
    --accent: #00d9ff;
    --bg-primary: #0a0e17;
    --bg-secondary: #141825;
    --bg-tertiary: #1e2433;
    --bg-card: #252b3d;
    --text-primary: #e8ecf3;
    --text-secondary: #a8b3cf;
    --text-muted: #6b7689;
    --border: #2d3548;
    --border-hover: #3d4558;
    --success: #00d084;
    --warning: #ffb300;
    --error: #ff3860;
    --shadow: rgba(0, 0, 0, 0.3);
    --glow: rgba(255, 107, 53, 0.2);
}

[data-theme="light"] {
    --primary: #ff6b35;
    --primary-dark: #e85a2a;
    --primary-light: #ff8456;
    --accent: #0088cc;
    --bg-primary: #f8f9fb;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f0f2f5;
    --bg-card: #ffffff;
    --text-primary: #1a1f2e;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    --border: #e2e8f0;
    --border-hover: #cbd5e0;
    --success: #00a86b;
    --warning: #f59e0b;
    --error: #ef4444;
    --shadow: rgba(0, 0, 0, 0.08);
    --glow: rgba(255, 107, 53, 0.15);
}

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

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    transition: background 0.3s ease, color 0.3s ease;
    line-height: 1.6;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 30%, var(--glow) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, var(--glow) 0%, transparent 40%);
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
    z-index: 1;
}

/* Header */
.header {
    background: rgba(20, 24, 37, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

[data-theme="light"] .header {
    background: rgba(255, 255, 255, 0.9);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 20px;
    color: white;
    box-shadow: 0 4px 12px var(--glow);
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: translateY(-2px);
}

.title-group h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    margin-bottom: 4px;
}

.subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 400;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Hamburger Menu Button - DESKTOP'ta gizli */
.menu-toggle {
    display: none;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    padding: 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 44px;
    height: 44px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
}

.menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text-primary);
    transition: all 0.3s ease;
    border-radius: 2px;
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translateY(7px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translateY(-7px);
}

.btn-control {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    padding: 10px 18px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
}

.btn-control:hover {
    background: var(--bg-card);
    border-color: var(--border-hover);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.btn-control.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Navigation */
.sidebar {
    position: fixed;
    left: 0;
    top: 140px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    border-radius: 0 16px 16px 0;
    padding: 24px 0;
    width: 240px;
    max-height: calc(100vh - 180px);
    overflow-y: auto;
    box-shadow: 4px 0 12px var(--shadow);
    transition: transform 0.3s ease;
    z-index: 900;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.938rem;
    transition: all 0.2s ease;
    cursor: pointer;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
    border-left-color: var(--primary);
}

.nav-item.active {
    color: var(--primary);
    background: var(--bg-tertiary);
    border-left-color: var(--primary);
    font-weight: 600;
}

.nav-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
}

/* Mobile Overlay - DESKTOP'ta gizli */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 899;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.sidebar-overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* Main Content */
.main-content {
    margin-left: 260px;
    padding: 40px 20px;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.section {
    display: none;
    animation: fadeIn 0.4s ease;
}

.section.active {
    display: block;
}

.section-header {
    margin-bottom: 32px;
}

.section-header h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.section-header p {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.5;
}

/* Calculator Cards */
.calc-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px var(--shadow);
    transition: all 0.3s ease;
}

.calc-card:hover {
    border-color: var(--border-hover);
    box-shadow: 0 4px 16px var(--shadow);
}

.calc-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.calc-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    font-weight: 600;
}

/* Input Groups */
.input-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-wrapper label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    font-family: 'JetBrains Mono', monospace;
}

.input-wrapper input,
.input-wrapper textarea,
.input-wrapper select {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 16px;
    color: var(--text-primary);
    font-size: 0.938rem;
    font-family: 'Outfit', sans-serif;
    transition: all 0.2s ease;
    outline: none;
}

.input-wrapper input:focus,
.input-wrapper textarea:focus,
.input-wrapper select:focus {
    border-color: var(--primary);
    background: var(--bg-card);
    box-shadow: 0 0 0 3px var(--glow);
}

.input-wrapper textarea {
    min-height: 120px;
    resize: vertical;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 14px 28px;
    font-size: 0.938rem;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px var(--glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--glow);
}

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

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 28px;
    font-size: 0.938rem;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: var(--bg-card);
    border-color: var(--border-hover);
    transform: translateY(-1px);
}

/* Result Boxes */
.result-box {
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-card) 100%);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    margin-top: 24px;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.4s ease;
}

.result-box.show {
    opacity: 1;
    transform: translateY(0);
}

.result-text {
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.938rem;
    line-height: 1.8;
}

.result-text strong {
    color: var(--primary);
    font-weight: 600;
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 16px 24px;
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: 0 8px 24px var(--shadow);
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    font-size: 0.938rem;
    z-index: 10000;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

.toast-icon {
    width: 24px;
    height: 24px;
    background: var(--success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
}

/* Scroll to Top */
#scrollTop {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 48px;
    height: 48px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: 0 4px 12px var(--glow);
    transition: all 0.3s ease;
    z-index: 999;
}

#scrollTop:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px var(--glow);
}

#scrollTop.show {
    display: flex;
}

/* Footer */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 40px 0;
    margin-top: 80px;
    text-align: center;
}

.footer-content {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 16px;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--primary);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-hover);
}

/* ============================================ */
/* RESPONSIVE - TABLET VE MOBİL */
/* ============================================ */

/* Tablet - 1024px ve altı */
@media (max-width: 1024px) {
    /* Menü hamburger olsun */
    .menu-toggle {
        display: flex;
    }
    
    /* Sidebar gizli olsun */
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
        top: 0;
        max-height: 100vh;
        border-radius: 0;
        padding-top: 80px;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    /* Overlay göster */
    .sidebar-overlay {
        display: block;
    }
    
    /* Main content sol margin kaldır */
    .main-content {
        margin-left: 0;
        padding: 32px 20px;
    }
    
    .container {
        padding: 0 20px;
    }
}

/* Mobile - 768px ve altı */
@media (max-width: 768px) {
    .header {
        padding: 12px 0;
    }

    .container {
        padding: 0 16px;
    }

    .logo {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .logo-section {
        gap: 10px;
    }

    .title-group h1 {
        font-size: 1.125rem;
    }

    .subtitle {
        font-size: 0.688rem;
    }

    .header-controls {
        gap: 6px;
    }

    .btn-control {
        padding: 8px 12px;
        font-size: 0.75rem;
    }

    .main-content {
        padding: 24px 16px;
    }

    .section-header {
        margin-bottom: 24px;
    }

    .section-header h2 {
        font-size: 1.5rem;
        line-height: 1.3;
    }

    .section-header p {
        font-size: 0.938rem;
    }

    .calc-card {
        padding: 20px;
        margin-bottom: 20px;
        border-radius: 12px;
    }

    .calc-card h3 {
        font-size: 1.125rem;
        margin-bottom: 16px;
        gap: 10px;
    }

    .calc-icon {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }

    .input-group {
        grid-template-columns: 1fr;
        gap: 16px;
        margin-bottom: 20px;
    }

    .input-wrapper input,
    .input-wrapper textarea,
    .input-wrapper select {
        padding: 10px 14px;
        font-size: 0.875rem;
    }

    .input-wrapper label {
        font-size: 0.813rem;
    }

    .btn-primary,
    .btn-secondary {
        padding: 12px 24px;
        font-size: 0.875rem;
    }

    .result-box {
        padding: 18px;
        margin-top: 20px;
    }

    .result-text {
        font-size: 0.813rem;
        line-height: 1.7;
    }

    .toast {
        bottom: 20px;
        right: 20px;
        padding: 14px 20px;
        font-size: 0.875rem;
        max-width: calc(100% - 40px);
    }

    #scrollTop {
        bottom: 20px;
        right: 20px;
        width: 44px;
        height: 44px;
        font-size: 1.125rem;
    }

    .footer {
        padding: 32px 0;
        margin-top: 60px;
    }

    .footer-links {
        gap: 16px;
        font-size: 0.813rem;
        flex-wrap: wrap;
    }

    .sidebar {
        width: 260px;
    }
}

/* Small Mobile - 480px ve altı */
@media (max-width: 480px) {
    .container {
        padding: 0 12px;
    }

    .logo {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }

    .title-group h1 {
        font-size: 1rem;
    }

    .subtitle {
        display: none;
    }

    .btn-control {
        padding: 8px 10px;
        font-size: 0.688rem;
    }

    .main-content {
        padding: 20px 12px;
    }

    .section-header h2 {
        font-size: 1.25rem;
    }

    .section-header p {
        font-size: 0.875rem;
    }

    .calc-card {
        padding: 16px;
        border-radius: 10px;
    }

    .calc-card h3 {
        font-size: 1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .input-group {
        gap: 12px;
    }

    .input-wrapper input,
    .input-wrapper textarea,
    .input-wrapper select {
        padding: 10px 12px;
        font-size: 0.813rem;
    }

    .btn-primary,
    .btn-secondary {
        padding: 11px 20px;
        font-size: 0.813rem;
    }

    .result-box {
        padding: 16px;
    }

    .result-text {
        font-size: 0.75rem;
    }

    .toast {
        bottom: 16px;
        right: 16px;
        left: 16px;
        padding: 12px 16px;
        font-size: 0.813rem;
        max-width: unset;
    }

    #scrollTop {
        bottom: 16px;
        right: 16px;
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .footer {
        padding: 24px 0;
        margin-top: 40px;
    }

    .footer-content {
        font-size: 0.75rem;
    }

    .footer-links {
        flex-direction: column;
        gap: 12px;
    }

    .sidebar {
        width: 240px;
    }

    .nav-item {
        padding: 10px 20px;
        font-size: 0.875rem;
    }
}

/* Extra Small - 360px ve altı */
@media (max-width: 360px) {
    .logo {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }

    .title-group h1 {
        font-size: 0.938rem;
    }

    .section-header h2 {
        font-size: 1.125rem;
    }

    .calc-card {
        padding: 14px;
    }

    .input-wrapper input,
    .input-wrapper textarea,
    .input-wrapper select {
        padding: 8px 10px;
    }

    .sidebar {
        width: 220px;
    }
}

/* Landscape Mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .header {
        padding: 8px 0;
    }

    .logo {
        width: 32px;
        height: 32px;
    }

    .main-content {
        padding: 16px;
    }

    .section-header {
        margin-bottom: 16px;
    }

    .calc-card {
        padding: 16px;
    }

    .sidebar {
        padding-top: 60px;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .btn-control,
    .btn-primary,
    .btn-secondary,
    .nav-item {
        -webkit-tap-highlight-color: transparent;
    }

    .nav-item:active {
        background: var(--bg-card);
    }

    .btn-primary:active {
        transform: scale(0.98);
    }

    input,
    textarea,
    select {
        font-size: 16px !important;
    }
}
