* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #fafbfc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f7fafc;
    --bg-hover: #edf2f7;
    --text-primary: #1a202c;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    --border-color: #e2e8f0;
    --border-hover: #cbd5e0;
    --accent-color: #3182ce;
    --accent-hover: #2c5aa0;
    --shadow-light: rgba(0, 0, 0, 0.05);
    --shadow-medium: rgba(0, 0, 0, 0.08);
    --shadow-accent: rgba(49, 130, 206, 0.3);
}

[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --bg-hover: #475569;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e0;
    --text-muted: #94a3b8;
    --border-color: #475569;
    --border-hover: #64748b;
    --accent-color: #60a5fa;
    --accent-hover: #3b82f6;
    --shadow-light: rgba(0, 0, 0, 0.3);
    --shadow-medium: rgba(0, 0, 0, 0.4);
    --shadow-accent: rgba(96, 165, 250, 0.3);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.7;
    font-weight: 400;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

header {
    text-align: center;
    margin-bottom: 60px;
    color: var(--text-primary);
}

header h1 {
    font-size: 2.8rem;
    font-weight: 300;
    margin-bottom: 16px;
    color: var(--text-secondary);
    letter-spacing: -0.02em;
}

header p {
    font-size: 1.2rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-bottom: 32px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Navigasyon menüsü */
.nav-menu {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 32px;
}

.nav-link {
    display: inline-block;
    padding: 14px 28px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px var(--shadow-light);
}

.nav-link:hover {
    background: var(--bg-tertiary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--shadow-medium);
    border-color: var(--border-hover);
}

.nav-link.active {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
    box-shadow: 0 4px 12px var(--shadow-accent);
}

main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 60px;
}

/* Ana sayfa için tek kolon düzeni */
.homepage-layout main {
    grid-template-columns: 1fr;
    max-width: 700px;
    margin: 0 auto 60px auto;
    gap: 16px;
}

.calculator-card, .info-card {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 1px 3px var(--shadow-light);
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.calculator-card:hover, .info-card:hover {
    box-shadow: 0 4px 20px var(--shadow-medium);
    transform: translateY(-2px);
}

.calculator-card h3, .info-card h3 {
    color: var(--text-secondary);
    margin-bottom: 0;
    font-size: 1.4rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

/* Ana sayfa kartları için minimal tasarım */
.homepage-layout .calculator-card {
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.homepage-layout .calculator-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    border-color: var(--accent-color);
}

.homepage-layout .calculator-card h3 {
    text-align: center;
    margin-bottom: 16px;
}

.homepage-layout .calculator-card p {
    text-align: left;
    margin-bottom: 8px;
}

.homepage-layout .calculator-card .calculate-btn {
    margin: 0;
    padding: 12px 24px;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: 8px;
    width: 100%;
    background: var(--accent-color);
    transition: all 0.2s ease;
    text-decoration: none;
    text-align: center;
    display: block;
}

.homepage-layout .calculator-card .calculate-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(49, 130, 206, 0.3);
    text-decoration: none;
}

/* Ana sayfa için navigasyon merkezi hizalama */
.homepage-layout .nav-menu {
    justify-content: center;
}

.input-section, .dava-type-section {
    margin-bottom: 40px;
}

/* Fieldset border'ını kaldır */
.dava-type-section fieldset {
    border: none !important;
    margin: 0 !important;
    padding: 0 !important;
    outline: none !important;
}

.dava-type-section legend {
    display: block;
    margin-bottom: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Tüm fieldset elementlerinin border'ını kaldır */
fieldset {
    border: none !important;
    margin: 0 !important;
    padding: 0 !important;
    outline: none !important;
}

label {
    display: block;
    margin-bottom: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Input stillerini güçlendir */
.input-group {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 2px solid var(--border-color);
    transition: all 0.2s ease;
    min-height: 60px;
    overflow: hidden;
}

.input-group:hover {
    border-color: var(--border-hover);
    box-shadow: 0 4px 12px var(--shadow-light);
}

.input-group:focus-within {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.1);
}

input[type="text"], input[type="number"], input[type="date"] {
    width: 100%;
    padding: 18px 24px;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 500;
    transition: all 0.2s ease;
    background: transparent;
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    letter-spacing: 0.025em;
    box-sizing: border-box;
    min-height: 60px;
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

input[type="text"]:hover, input[type="number"]:hover, input[type="date"]:hover {
    background: var(--bg-tertiary);
}

input[type="text"]:focus, input[type="number"]:focus, input[type="date"]:focus {
    outline: none;
    background: var(--bg-secondary);
}

input[type="text"]::placeholder, input[type="number"]::placeholder, input[type="date"]::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
    font-weight: 400;
}

input[type="text"]:focus::placeholder, input[type="number"]:focus::placeholder, input[type="date"]:focus::placeholder {
    opacity: 0.5;
}

/* Input biçimsizliği için ek güvenlik */
input[type="text"], input[type="number"], input[type="date"] {
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
    margin: 0;
    padding: 18px 24px;
    line-height: normal;
    vertical-align: middle;
}

/* Tarih inputu: sistem ikonunu iyileştir */
input[type="date"] {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: transparent;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    background: var(--bg-tertiary);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 6px;
    margin-left: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
    background: var(--accent-color);
    border-color: var(--accent-color);
}

.currency, .unit {
    position: absolute;
    right: 20px;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 1.1rem;
    background: var(--bg-tertiary);
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.currency:hover, .unit:hover {
    background: var(--accent-color);
    color: white;
    transform: scale(1.05);
}

.input-hint {
    display: block;
    margin-top: 8px;
    font-size: 0.875rem;
    color: var(--text-muted);
    font-style: italic;
    opacity: 0.8;
    transition: all 0.2s ease;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    border-left: 3px solid var(--accent-color);
    margin-left: 4px;
}

.input-hint:hover {
    opacity: 1;
    background: var(--bg-hover);
    transform: translateX(4px);
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.radio-item {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 16px 20px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    transition: all 0.2s ease;
    background: var(--bg-secondary);
}

.radio-item:hover {
    border-color: var(--accent-color);
    background: var(--bg-tertiary);
}

.radio-item input[type="radio"] {
    display: none;
}

.radio-custom {
    width: 22px;
    height: 22px;
    border: 2px solid var(--border-hover);
    border-radius: 50%;
    margin-right: 16px;
    position: relative;
    transition: all 0.2s ease;
}

.radio-item input[type="radio"]:checked + .radio-custom {
    border-color: var(--accent-color);
    background: var(--accent-color);
}

.radio-item input[type="radio"]:checked + .radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
}

.calculate-btn {
    width: 100%;
    padding: 18px;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 32px;
    letter-spacing: 0.01em;
}

.calculate-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px var(--shadow-accent);
}

.calculate-btn:active {
    transform: translateY(0);
}

.results-section {
    border-top: 2px solid var(--border-color);
    padding-top: 32px;
}

.results-section h3 {
    color: var(--text-secondary);
    margin-bottom: 24px;
    text-align: center;
    font-weight: 600;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
}

.result-item:last-child {
    border-bottom: none;
}

.result-item.highlight {
    background: var(--bg-tertiary);
    margin: 20px -20px;
    padding: 20px;
    border-radius: 12px;
    border: 2px solid var(--accent-color);
}

.result-item.total {
    background: var(--accent-color);
    color: white;
    margin: 24px -20px -20px;
    padding: 24px 20px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1.1rem;
}

.result-label {
    font-weight: 500;
    color: var(--text-secondary);
}

.result-item.total .result-label {
    color: white;
}

.result-value {
    font-weight: 600;
    color: var(--text-primary);
}

.result-item.total .result-value {
    color: white;
}

.info-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.info-item {
    background: var(--bg-tertiary);
    padding: 24px;
    border-radius: 12px;
    border-left: 4px solid var(--accent-color);
}

.info-item strong {
    color: var(--text-secondary);
    display: block;
    margin-bottom: 12px;
    font-size: 1.1rem;
    font-weight: 600;
}

.info-item ul {
    list-style: none;
    padding-left: 0;
}

.info-item li {
    padding: 6px 0;
    color: var(--text-secondary);
    position: relative;
    padding-left: 24px;
    line-height: 1.6;
}

.info-item li::before {
    content: '•';
    color: var(--accent-color);
    font-weight: bold;
    position: absolute;
    left: 0;
    font-size: 1.2rem;
}

/* Toplam özet satırı */
.total-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    background: var(--bg-tertiary);
}

.total-summary .label {
    color: var(--text-secondary);
    font-weight: 600;
    letter-spacing: 0.2px;
}

.total-summary .value {
    color: var(--accent-color);
    font-weight: 800;
    font-size: 1.15rem;
}

footer {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Tema toggle butonu */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 50px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px var(--shadow-light);
    z-index: 1000;
}

.theme-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px var(--shadow-medium);
    border-color: var(--accent-color);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
    fill: var(--text-secondary);
    transition: fill 0.3s ease;
}

.theme-toggle:hover svg {
    fill: var(--accent-color);
}

/* Checkbox stilleri */
.checkbox-item {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 14px 18px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    transition: all 0.2s ease;
    background: var(--bg-secondary);
    margin-bottom: 6px;
}

.checkbox-item:hover {
    border-color: var(--accent-color);
    background: var(--bg-tertiary);
}

.checkbox-item input[type="checkbox"] {
    display: none;
}

.checkbox-custom {
    width: 22px;
    height: 22px;
    border: 2px solid var(--border-hover);
    border-radius: 6px;
    margin-right: 16px;
    position: relative;
    transition: all 0.2s ease;
    background: var(--bg-secondary);
}

.checkbox-item input[type="checkbox"]:checked + .checkbox-custom {
    border-color: var(--accent-color);
    background: var(--accent-color);
}

.checkbox-item input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
    font-weight: bold;
}

/* Responsive Design */
@media (max-width: 768px) {
    main {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    
    header h1 {
        font-size: 2.2rem;
    }
    
    .calculator-card, .info-card {
        padding: 32px 24px;
    }
    
    .container {
        padding: 32px 16px;
    }
    
    .nav-menu {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }
    
    .nav-link {
        width: 220px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 2rem;
    }
    
    .calculator-card, .info-card {
        padding: 24px 20px;
    }
    
    input[type="number"], input[type="date"] {
        padding: 16px 20px;
        font-size: 1rem;
    }
    
    .calculate-btn {
        padding: 16px;
        font-size: 1rem;
    }
    
    .nav-link {
        width: 200px;
        padding: 12px 24px;
        font-size: 0.95rem;
    }
}

/* Animation for results */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.results-section {
    animation: fadeInUp 0.4s ease-out;
}

/* Loading state */
.calculate-btn.loading {
    background: #a0aec0;
    cursor: not-allowed;
    transform: none;
}

.calculate-btn.loading::after {
    content: '';
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.tebligat-type-section {
    margin-bottom: 40px;
}

.tebligat-type-section label {
    display: block;
    margin-bottom: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Tebligat sayfası için özel input stilleri */
.tebligat-type-section .radio-group {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.tebligat-type-section .radio-item {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 16px 20px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    transition: all 0.2s ease;
    background: var(--bg-secondary);
}

.tebligat-type-section .radio-item:hover {
    border-color: var(--accent-color);
    background: var(--bg-tertiary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--shadow-light);
}

