/* Modern ve Kullanıcı Dostu Tasarım */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px 20px;
    text-align: center;
    position: relative;
    width: 100%;
}

.header h1 {
    font-size: 2rem;
    font-weight: 300;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    line-height: 1.2;
}

.header h2 {
    font-size: 1rem;
    font-weight: 300;
    opacity: 0.9;
    line-height: 1.3;
}

.content {
    padding: 20px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    min-height: calc(100vh - 120px);
}

.form-group {
    margin-bottom: 20px;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    border-left: 4px solid #667eea;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.form-group:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.form-group label {
    display: block;
    margin-bottom: 12px;
    font-weight: 600;
    color: #495057;
    font-size: 1rem;
    line-height: 1.4;
}

.form-group input[type="date"] {
    width: 100%;
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px; /* Mobil için minimum font boyutu */
    transition: all 0.3s ease;
    background: white;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.form-group input[type="date"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group input[type="date"]:disabled {
    background: #f8f9fa;
    color: #6c757d;
    cursor: not-allowed;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 15px;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.radio-option:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.radio-option input[type="radio"] {
    width: 20px;
    height: 20px;
    accent-color: #667eea;
    flex-shrink: 0;
}

.radio-option input[type="radio"]:checked + label {
    color: #667eea;
    font-weight: 600;
}

.radio-option label {
    margin: 0;
    cursor: pointer;
    font-weight: 500;
    font-size: 1rem;
    flex: 1;
}

.highlighted-date {
    font-weight: 700;
    color: #667eea;
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
    margin: 5px 0;
    word-break: break-word;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 15px 0;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    font-size: 0.9rem;
    table-layout: fixed; /* Sütun genişliklerini sabitle */
}

th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 8px;
    font-weight: 600;
    text-align: left;
    font-size: 0.9rem;
    white-space: normal; /* Başlıkları satır sonunda böl */
    word-wrap: break-word;
    overflow-wrap: break-word;
}

td {
    padding: 12px 8px;
    border-bottom: 1px solid #e9ecef;
    vertical-align: middle;
    word-break: break-word;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

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

tr:hover {
    background: #f8f9ff;
}

/* Tablo içindeki input alanları için özel stil */
table input[type="date"] {
    padding: 8px;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 100%;
    min-width: auto; /* Minimum genişlik kaldırıldı */
    box-sizing: border-box;
}

.button-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 25px 0;
}

.btn {
    padding: 15px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 50px;
    -webkit-tap-highlight-color: transparent;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover, .btn-primary:active {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.btn-success:hover, .btn-success:active {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: white;
}

.btn-secondary:hover, .btn-secondary:active {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(108, 117, 125, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
}

.btn-danger:hover, .btn-danger:active {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(220, 53, 69, 0.3);
}

.help-icon {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    font-weight: bold;
    z-index: 1000;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

.help-icon:hover, .help-icon:active {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

/* Modal Stilleri */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    -webkit-overflow-scrolling: touch;
    padding: 20px;
    box-sizing: border-box;
}

.modal-content {
    background: white;
    margin: 0 auto;
    padding: 25px 20px;
    border-radius: 15px;
    width: 100%;
    max-width: 600px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
    position: relative;
    animation: modalSlideIn 0.3s ease;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    box-sizing: border-box;
}

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

.close {
    position: absolute;
    top: 15px;
    right: 20px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
    line-height: 1;
    padding: 5px;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.close:hover, .close:active {
    color: #667eea;
    background: #f8f9fa;
}

/* Modal içindeki sonuç kartları için özel stiller */
.modal-content .result-card {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    margin-bottom: 20px;
}

.modal-content .result-card h3 {
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.modal-content .result-card .result-number {
    font-size: 2.5rem;
    font-weight: bold;
    margin: 10px 0;
}

.modal-content .result-card .result-unit {
    font-size: 0.9rem;
    opacity: 0.9;
}

.modal-content .result-status {
    background: #d4edda;
    border: 2px solid #c3e6cb;
    border-radius: 15px;
    padding: 20px;
    margin-top: 20px;
}

.modal-content .result-status h3 {
    color: #155724;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.modal-content .result-status p {
    font-size: 1.2rem;
    font-weight: 600;
    color: #155724;
    margin-bottom: 15px;
}

.modal-content .result-status .congrats {
    color: #155724;
    font-size: 1rem;
    margin-top: 15px;
}

/* Modal içindeki grid düzeni için responsive stiller */
.modal-content .results-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
    max-width: 100%;
}

/* Responsive Modal */
@media (max-width: 768px) {
    .modal {
        padding: 15px;
    }
    
    .modal-content {
        margin: 0 auto;
        padding: 20px 15px;
        max-height: calc(100vh - 30px);
        width: 100%;
    }
    
    .close {
        top: 10px;
        right: 15px;
        width: 30px;
        height: 30px;
        font-size: 24px;
    }
    
    .modal-content .result-card {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .modal-content .result-card h3 {
        font-size: 1.1rem;
    }
    
    .modal-content .result-card .result-number {
        font-size: 2rem;
    }
    
    .modal-content .result-status {
        padding: 15px;
    }
    
    .modal-content .result-status h3 {
        font-size: 1.2rem;
    }
    
    .modal-content .result-status p {
        font-size: 1.1rem;
    }
    
    /* Mobilde grid tek sütun */
    .modal-content .results-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .modal {
        padding: 10px;
    }
    
    .modal-content {
        margin: 0 auto;
        padding: 18px 12px;
        max-height: calc(100vh - 20px);
    }
    
    .close {
        top: 8px;
        right: 12px;
        width: 28px;
        height: 28px;
        font-size: 22px;
    }
    
    .modal-content .result-card {
        padding: 12px;
        margin-bottom: 12px;
    }
    
    .modal-content .result-card h3 {
        font-size: 1rem;
    }
    
    .modal-content .result-card .result-number {
        font-size: 1.8rem;
    }
    
    .modal-content .result-status {
        padding: 12px;
    }
    
    .modal-content .result-status h3 {
        font-size: 1.1rem;
    }
    
    .modal-content .result-status p {
        font-size: 1rem;
    }
    
    /* Çok küçük ekranlarda daha kompakt */
    .modal-content .results-grid {
        gap: 10px;
    }
}

/* Landscape modunda modal optimizasyonu */
@media (max-height: 500px) and (orientation: landscape) {
    .modal {
        padding: 10px;
    }
    
    .modal-content {
        margin: 0 auto;
        max-height: calc(100vh - 20px);
        padding: 15px 20px;
    }
    
    .modal-content .result-card {
        padding: 12px;
        margin-bottom: 10px;
    }
    
    .modal-content .result-card .result-number {
        font-size: 1.8rem;
    }
    
    .modal-content .result-status {
        padding: 12px;
    }
    
    /* Landscape'de grid yan yana kalsın ama daha kompakt */
    .modal-content .results-grid {
        gap: 15px;
    }
}

#results {
    margin-top: 25px;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    border-left: 4px solid #28a745;
    font-size: 1rem;
    line-height: 1.5;
}

/* Responsive Tasarım - Mobil Öncelikli */
@media (max-width: 768px) {
    .header {
        padding: 25px 15px;
    }
    
    .header h1 {
        font-size: 1.8rem;
        line-height: 1.3;
    }
    
    .header h2 {
        font-size: 0.95rem;
        line-height: 1.4;
    }
    
    .content {
        padding: 15px;
    }
    
    .form-group {
        padding: 18px;
        margin-bottom: 18px;
    }
    
    .form-group label {
        font-size: 0.95rem;
        line-height: 1.4;
    }
    
    .form-group input[type="date"] {
        padding: 12px;
        font-size: 16px;
    }
    
    .radio-option {
        padding: 12px;
    }
    
    .radio-option input[type="radio"] {
        width: 18px;
        height: 18px;
    }
    
    .radio-option label {
        font-size: 0.95rem;
    }
    
    .button-group {
        gap: 10px;
        margin: 20px 0;
    }
    
    .btn {
        padding: 14px 18px;
        font-size: 0.95rem;
        min-height: 48px;
    }
    
    .help-icon {
        top: 15px;
        right: 15px;
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
    
    table {
        font-size: 0.85rem;
        margin: 12px 0;
    }
    
    th, td {
        padding: 10px 6px;
    }
    
    /* Tablo içindeki input alanları için mobil optimizasyon */
    table input[type="date"] {
        padding: 6px;
        font-size: 13px;
        min-width: 100px;
    }
    
    /* Mobilde tablo yatay kaydırma */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 12px;
    }
    
    /* Mobilde tablo düzeni */
    table {
        width: 100%;
        table-layout: fixed;
    }
    
    th, td {
        padding: 8px 4px;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    /* Mobilde input alanları */
    table input[type="date"] {
        width: 100%;
        min-width: auto;
        box-sizing: border-box;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.6rem;
    }
    
    .header h2 {
        font-size: 0.9rem;
    }
    
    .form-group {
        padding: 15px;
    }
    
    .form-group label {
        font-size: 0.9rem;
    }
    
    .form-group input[type="date"] {
        padding: 10px;
    }
    
    .radio-option {
        padding: 10px;
    }
    
    .radio-option input[type="radio"] {
        width: 16px;
        height: 16px;
    }
    
    .radio-option label {
        font-size: 0.9rem;
    }
    
    .btn {
        padding: 12px 16px;
        font-size: 0.9rem;
        min-height: 45px;
    }
    
    .help-icon {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .modal-content {
        margin: 5% auto;
        padding: 18px 12px;
    }
    
    table {
        font-size: 0.8rem;
    }
    
    th, td {
        padding: 8px 4px;
    }
    
    /* Çok küçük ekranlarda tablo dikey düzen */
    @media (max-width: 360px) {
        .table-container {
            overflow-x: auto;
        }
        
        table {
            min-width: 300px;
        }
    }
    
    /* Çok küçük ekranlarda tablo düzeni */
    @media (max-width: 480px) {
        table {
            font-size: 0.75rem;
        }
        
        th, td {
            padding: 6px 2px;
        }
        
        table input[type="date"] {
            padding: 6px;
            font-size: 0.75rem;
        }
    }
}

/* Özel Durumlar */
#hesaplanmisTarih {
    display: none;
}

.sağlanmıştır {
    color: #28a745;
    font-weight: 700;
    text-transform: uppercase;
}

.sağlanmamıştır {
    color: #dc3545;
    font-weight: 700;
    text-transform: uppercase;
}

/* Animasyonlar */
.form-group, .btn, table {
    animation: fadeInUp 0.6s ease;
}

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

/* Loading Efekti */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Touch cihazlar için ek optimizasyonlar */
@media (hover: none) and (pointer: coarse) {
    .btn:hover {
        transform: none;
    }
    
    .form-group:hover {
        transform: none;
    }
    
    .help-icon:hover {
        transform: none;
    }
    
    /* Touch için daha büyük dokunma alanları */
    .btn {
        min-height: 48px;
    }
    
    .radio-option {
        min-height: 44px;
    }
    
    input[type="date"] {
        min-height: 44px;
    }
}

/* Yüksek DPI ekranlar için */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .form-group {
        border-radius: 14px;
    }
    
    .btn {
        border-radius: 10px;
    }
}

