/* =====================================================================
   AUTHENTICATION MODALS CSS - NHForum Theme
   Modern, responsive modal authentication system
   ===================================================================== */

/* ===== MODAL OVERLAY ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9998;
    display: none !important;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    visibility: hidden !important;
}

.modal-overlay.active {
    display: flex !important;
    visibility: visible !important;
    opacity: 1;
}

/* ===== AUTHENTICATION MODALS ===== */
.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none !important;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
    opacity: 0;
    transform: scale(0.9) translateY(-20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    visibility: hidden !important;
}

.auth-modal.active {
    display: flex !important;
    visibility: visible !important;
    opacity: 1;
    transform: scale(1) translateY(0);
}

/* ===== MODAL CONTENT ===== */
.auth-modal .modal-content {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.15),
        0 10px 20px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 450px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ===== MODAL HEADER ===== */
.modal-header {
    padding: 25px 30px 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, var(--primary-color, #06b6d4) 0%, #3b82f6 100%);
    border-radius: 20px 20px 0 0;
    color: white;
}

.modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-header h3 i {
    font-size: 18px;
    opacity: 0.9;
}

.modal-close {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

/* ===== MODAL BODY ===== */
.modal-body {
    padding: 30px;
}

/* ===== MODAL INFO ===== */
.modal-info {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1px solid #bae6fd;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 25px;
    color: #0c4a6e;
}

.modal-info p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.modal-info i {
    margin-top: 2px;
    color: var(--primary-color, #06b6d4);
}

/* ===== AUTH FORM ===== */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ===== FORM GROUPS ===== */
.form-group {
    position: relative;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
    font-size: 14px;
}

/* ===== FORM INPUT WRAPPER ===== */
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

/* ===== FORM INPUTS ===== */
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"] {
    width: 100%;
    height: 48px; /* Sabit yükseklik */
    padding: 0 45px 0 45px; /* Sol ve sağ padding ikona yer bırak */
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 15px;
    font-family: inherit;
    background: #f9fafb;
    transition: all 0.2s ease;
    box-sizing: border-box;
    line-height: 1;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color, #06b6d4);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.1);
}

.form-group input:invalid {
    border-color: #ef4444;
}

.form-group input:valid {
    border-color: #10b981;
}

/* ===== FORM INPUT IÇINDEKI IKONLAR ===== */
.form-group {
    position: relative;
}

/* Sol taraftaki ikonlar (kullanıcı, mail, etc.) */
.input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 16px;
    pointer-events: none;
    z-index: 2;
    transition: color 0.2s ease;
}

/* Input focus olduğunda ikon rengi */
.form-group input:focus ~ .input-icon,
.form-group input:focus + .input-icon {
    color: var(--primary-color, #06b6d4);
}

/* Sağ taraftaki ikonlar (göz ikonu, genel ikonlar) */
.form-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 14px;
    pointer-events: none;
    z-index: 2;
}

/* ===== PASSWORD TOGGLE ===== */
.password-toggle {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 8px;
    font-size: 16px;
    transition: color 0.2s ease;
    z-index: 3;
    border-radius: 4px;
}

/* Input'lar için sol padding artırılmalı */
.form-group.has-icon input[type="text"],
.form-group.has-icon input[type="email"],
.form-group.has-icon input[type="password"] {
    padding-left: 45px;
}

.password-toggle:hover {
    color: var(--primary-color, #06b6d4);
}

.password-toggle i.fa-eye-slash {
    color: var(--primary-color, #06b6d4);
}

/* ===== FORM HINT ===== */
.form-hint {
    font-size: 12px;
    color: #6b7280;
    margin-top: 5px;
    padding-left: 5px;
}

/* ===== PASSWORD STRENGTH ===== */
.password-strength {
    margin-top: 8px;
}

.strength-meter {
    width: 100%;
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 5px;
}

.strength-bar {
    height: 100%;
    width: 0;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.strength-bar.weak {
    width: 25%;
    background: #ef4444;
}

.strength-bar.fair {
    width: 50%;
    background: #f59e0b;
}

.strength-bar.good {
    width: 75%;
    background: #3b82f6;
}

.strength-bar.strong {
    width: 100%;
    background: #10b981;
}

.strength-text {
    font-size: 12px;
    color: #6b7280;
}

.strength-text span {
    font-weight: 600;
}

/* ===== CHECKBOX GROUP ===== */
.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.5;
    color: #374151;
    margin: 0;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkbox-custom {
    width: 18px;
    height: 18px;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-top: 2px;
    background: #ffffff;
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom {
    background: var(--primary-color, #06b6d4);
    border-color: var(--primary-color, #06b6d4);
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom::after {
    content: "\f00c";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    color: white;
    font-size: 11px;
}

.checkbox-label a {
    color: var(--primary-color, #06b6d4);
    text-decoration: none;
}

.checkbox-label a:hover {
    text-decoration: underline;
}

/* ===== FORM ACTIONS ===== */
.form-actions {
    margin-top: 10px;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    line-height: 1.4;
    position: relative;
    overflow: hidden;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color, #06b6d4) 0%, #3b82f6 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(6, 182, 212, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-full {
    width: 100%;
}

/* ===== BUTTON LOADING STATE ===== */
.btn .btn-loading {
    display: none;
}

.btn.loading .btn-text {
    display: none;
}

.btn.loading .btn-loading {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn.loading {
    pointer-events: none;
}

/* ===== MODAL LINKS ===== */
.modal-links {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.modal-links a {
    color: #6b7280;
    text-decoration: none;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.2s ease;
    padding: 8px 0;
}

.modal-links a:hover {
    color: var(--primary-color, #06b6d4);
}

.modal-links a i {
    width: 16px;
    text-align: center;
    opacity: 0.7;
}

/* ===== MESSAGE MODAL ===== */
.message-modal .modal-content {
    max-width: 400px;
}

.message-modal .modal-header {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.message-modal.error .modal-header {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.message-modal.warning .modal-header {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

#message-content {
    font-size: 15px;
    line-height: 1.6;
    color: #374151;
}

#message-content p {
    margin: 0 0 10px 0;
}

#message-content p:last-child {
    margin-bottom: 0;
}

/* ===== FORM VALIDATION ERRORS ===== */
.form-error {
    color: #ef4444;
    font-size: 13px;
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
    padding-left: 5px;
}

.form-error i {
    font-size: 12px;
}

.form-group.error input {
    border-color: #ef4444 !important;
    background-color: #fef2f2;
}

.form-group.success input {
    border-color: #10b981 !important;
    background-color: #f0fdf4;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 480px) {
    .auth-modal {
        padding: 15px;
        align-items: flex-start;
        padding-top: 40px;
    }
    
    .auth-modal .modal-content {
        max-width: 100%;
        border-radius: 16px;
        max-height: calc(100vh - 80px);
    }
    
    .modal-header {
        padding: 20px 25px 15px;
    }
    
    .modal-header h3 {
        font-size: 18px;
    }
    
    .modal-body {
        padding: 25px;
    }
    
    .form-group input {
        font-size: 16px; /* iOS zoom engellemek için */
    }
    
    .form-group.has-icon input {
        padding: 12px 40px 12px 45px; /* İkonlu input'lar için doğru padding */
    }
    
    .form-group:not(.has-icon) input {
        padding: 12px 40px 12px 15px; /* İkonsuz input'lar için normal padding */
    }
    
    .modal-links {
        flex-direction: column;
        gap: 15px;
    }
    
    .btn {
        padding: 14px 20px;
        font-size: 16px;
    }
}

/* ===== TABLET RESPONSIVE ===== */
@media (max-width: 768px) and (min-width: 481px) {
    .auth-modal .modal-content {
        max-width: 420px;
    }
    
    .modal-header {
        padding: 22px 28px 18px;
    }
    
    .modal-body {
        padding: 28px;
    }
}

/* ===== DARK MODE SUPPORT (Ready for future) ===== */
@media (prefers-color-scheme: dark) {
    .auth-modal .modal-content {
        background: #1f2937;
        border: 1px solid #374151;
        color: #f9fafb;
    }
    
    .modal-header {
        border-bottom-color: #374151;
    }
    
    .form-group label {
        color: #e5e7eb;
    }
    
    .form-group input {
        background: #111827;
        border-color: #374151;
        color: #f9fafb;
    }
    
    .form-group input:focus {
        background: #1f2937;
        border-color: var(--primary-color, #06b6d4);
    }
    
    .form-icon {
        color: #6b7280;
    }
    
    .modal-links {
        border-top-color: #374151;
    }
    
    .checkbox-custom {
        background: #111827;
        border-color: #6b7280;
    }
    
    .modal-info {
        background: rgba(6, 182, 212, 0.1);
        border-color: rgba(6, 182, 212, 0.3);
        color: #e0f2fe;
    }
}

/* ===== ACCESSIBILITY ===== */
.auth-modal:focus-within .modal-content {
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.15),
        0 10px 20px rgba(0, 0, 0, 0.1),
        0 0 0 2px rgba(6, 182, 212, 0.2);
}

/* Focus trap için */
.auth-modal [tabindex="-1"]:focus {
    outline: none;
}

/* Keyboard navigation */
.btn:focus,
input:focus,
.checkbox-label:focus-within {
    outline: 2px solid var(--primary-color, #06b6d4);
    outline-offset: 2px;
}

/* Screen reader support */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ===== ANIMATIONS ===== */
@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-30px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes modalSlideOut {
    from {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
    to {
        opacity: 0;
        transform: scale(0.9) translateY(-30px);
    }
}

.auth-modal.slide-in {
    animation: modalSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.auth-modal.slide-out {
    animation: modalSlideOut 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* ===== PERFORMANCE OPTIMIZATIONS ===== */
.auth-modal,
.modal-overlay {
    will-change: transform, opacity;
}

.modal-content {
    will-change: transform;
}

/* ===== HIGH DPI SUPPORT ===== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .modal-content {
        box-shadow: 
            0 20px 40px rgba(0, 0, 0, 0.12),
            0 10px 20px rgba(0, 0, 0, 0.08);
    }
}
