/* Mobil DateTime Input Tasarımı */

/* Genel datetime-local input stilleri */
input[type="datetime-local"] {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    background: white;
    color: #333;
    transition: all 0.3s ease;
    box-sizing: border-box;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

input[type="datetime-local"]:focus {
    border-color: #0568c4;
    outline: none;
    box-shadow: 0 0 0 3px rgba(5, 104, 196, 0.1);
}

input[type="datetime-local"]:hover {
    border-color: #0568c4;
}

/* Mobil için özel düzenlemeler */
@media (max-width: 768px) {
    input[type="datetime-local"] {
        font-size: 16px; /* iOS zoom'u önlemek için */
        padding: 15px 12px;
        min-height: 50px;
        border-radius: 10px;
        border: 2px solid #e1e5e9;
        background: #f8f9fa;
        color: #333;
        font-weight: 500;
    }
    
    input[type="datetime-local"]:focus {
        background: white;
        border-color: #0568c4;
        box-shadow: 0 0 0 3px rgba(5, 104, 196, 0.15);
        transform: translateY(-1px);
    }
    
    /* Form group içindeki datetime input */
    .form-group input[type="datetime-local"] {
        margin-top: 8px;
        width: 100%;
        display: block;
    }
    
    /* Label ile datetime input arasındaki boşluk */
    .form-group label + input[type="datetime-local"] {
        margin-top: 8px;
    }
    
    /* SweetAlert içindeki datetime input */
    .swal2-popup input[type="datetime-local"] {
        width: 100%;
        margin: 10px 0;
        padding: 12px 15px;
        font-size: 16px;
        border: 2px solid #e1e5e9;
        border-radius: 8px;
        background: #f8f9fa;
    }
    
    .swal2-popup input[type="datetime-local"]:focus {
        background: white;
        border-color: #0568c4;
        box-shadow: 0 0 0 3px rgba(5, 104, 196, 0.15);
    }
}

/* Çok küçük ekranlar için */
@media (max-width: 480px) {
    input[type="datetime-local"] {
        font-size: 16px;
        padding: 12px 10px;
        min-height: 48px;
    }
    
    /* Form container padding */
    .homework-form,
    .test-selection {
        padding: 15px;
    }
    
    .form-group {
        margin-bottom: 20px;
    }
    
    .form-group label {
        font-size: 14px;
        font-weight: 600;
        color: #333;
        margin-bottom: 8px;
        display: block;
    }
}

/* Dark mode desteği */
@media (prefers-color-scheme: dark) {
    input[type="datetime-local"] {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    input[type="datetime-local"]:focus {
        background: #1a202c;
        border-color: #0568c4;
    }
}

/* iOS Safari için özel düzenlemeler */
@supports (-webkit-touch-callout: none) {
    input[type="datetime-local"] {
        font-size: 16px; /* Zoom'u önlemek için */
        -webkit-appearance: none;
        border-radius: 8px;
    }
}

/* Android Chrome için özel düzenlemeler */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    input[type="datetime-local"] {
        font-size: 16px;
        -webkit-appearance: none;
    }
}

/* Placeholder stilini gizle (datetime-local'da placeholder yok) */
input[type="datetime-local"]::-webkit-datetime-edit-text {
    color: #666;
    padding: 0 2px;
}

input[type="datetime-local"]::-webkit-datetime-edit-month-field,
input[type="datetime-local"]::-webkit-datetime-edit-day-field,
input[type="datetime-local"]::-webkit-datetime-edit-year-field {
    color: #333;
    font-weight: 500;
}

input[type="datetime-local"]::-webkit-datetime-edit-hour-field,
input[type="datetime-local"]::-webkit-datetime-edit-minute-field {
    color: #333;
    font-weight: 500;
}

/* Focus durumunda renk değişimi */
input[type="datetime-local"]:focus::-webkit-datetime-edit-text,
input[type="datetime-local"]:focus::-webkit-datetime-edit-month-field,
input[type="datetime-local"]:focus::-webkit-datetime-edit-day-field,
input[type="datetime-local"]:focus::-webkit-datetime-edit-year-field,
input[type="datetime-local"]:focus::-webkit-datetime-edit-hour-field,
input[type="datetime-local"]:focus::-webkit-datetime-edit-minute-field {
    color: #0568c4;
}

/* Form validation stilleri */
input[type="datetime-local"]:invalid {
    border-color: #e53e3e;
    background: #fed7d7;
}

input[type="datetime-local"]:valid {
    border-color: #38a169;
    background: #c6f6d5;
}

/* Loading state */
input[type="datetime-local"]:disabled {
    background: #f7fafc;
    border-color: #e2e8f0;
    color: #a0aec0;
    cursor: not-allowed;
}

/* Hover effect */
input[type="datetime-local"]:not(:disabled):hover {
    border-color: #0568c4;
    box-shadow: 0 2px 4px rgba(5, 104, 196, 0.1);
}

/* Active state */
input[type="datetime-local"]:not(:disabled):active {
    transform: translateY(1px);
    box-shadow: 0 1px 2px rgba(5, 104, 196, 0.2);
}
