/**
 * Authentication Modal Styles
 * For header modal login/register
 *
 * @package Media_Khodro
 */

/* Use theme fonts - but keep Font Awesome icons */
.mk-auth-modal,
.mk-auth-modal * {
    font-family: 'IRANYekan', 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

/* Ensure Font Awesome icons are visible */
.mk-auth-modal i[class^="fa"],
.mk-auth-modal i[class*=" fa-"],
.mk-auth-modal .fas,
.mk-auth-modal .far,
.mk-auth-modal .fal,
.mk-auth-modal .fab {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Pro", "FontAwesome" !important;
    font-weight: 900 !important;
    font-style: normal !important;
    font-variant: normal !important;
    text-rendering: auto !important;
    line-height: 1 !important;
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
}

/* Modal Overlay */
.mk-auth-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mk-auth-modal.active {
    display: flex;
    opacity: 1;
}

.mk-auth-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.mk-auth-modal-content {
    position: relative;
    background: #fff;
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    margin: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: mkModalSlideIn 0.3s ease;
    z-index: 10000;
}

@keyframes mkModalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.mk-auth-modal-close {
    position: absolute;
    top: 15px;
    left: 15px;
    width: 36px;
    height: 36px;
    border: none;
    background: #f5f5f5;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.3s ease;
    color: #666;
}

.mk-auth-modal-close:hover {
    background: #e0e0e0;
    transform: rotate(90deg);
}

.mk-auth-modal-close i {
    font-size: 18px;
    display: inline-block !important;
    visibility: visible !important;
}

/* Auth Tabs */
.mk-auth-tabs {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    border-radius: 20px 20px 0 0;
}

.mk-auth-tab {
    flex: 1;
    padding: 18px;
    border: none;
    background: transparent;
    color: #6c757d;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.mk-auth-tab:hover {
    background: #e9ecef;
    color: #495057;
}

.mk-auth-tab.active {
    background: #fff;
    color: #1E88E5;
    border-bottom: 2px solid #1E88E5;
}

.mk-auth-tab i {
    font-size: 16px;
    display: inline-block !important;
    visibility: visible !important;
    margin-left: 6px;
}

/* Auth Forms */
.mk-auth-forms {
    padding: 30px;
}

.mk-auth-form {
    display: none;
}

.mk-auth-form.active {
    display: block;
}

.mk-form-header {
    text-align: center;
    margin-bottom: 25px;
}

.mk-form-header h3 {
    font-size: 24px;
    font-weight: 700;
    color: #212529;
    margin: 0 0 8px 0;
}

.mk-form-header p {
    font-size: 14px;
    color: #6c757d;
    margin: 0;
}

/* Form Groups */
.mk-form-group {
    margin-bottom: 20px;
}

.mk-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #212529;
    margin-bottom: 8px;
}

.mk-form-group input[type="tel"],
.mk-form-group input[type="text"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.mk-form-group input[type="tel"]:focus,
.mk-form-group input[type="text"]:focus {
    outline: none;
    border-color: #1E88E5;
    box-shadow: 0 0 0 3px rgba(30, 136, 229, 0.1);
}

.mk-form-text {
    display: block;
    font-size: 12px;
    color: #6c757d;
    margin-top: 6px;
}

.mk-form-group.hidden {
    display: none;
}

/* Radio Group */
.mk-radio-group {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.mk-radio-label {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mk-radio-label:hover {
    border-color: #1E88E5;
    background: #f0f7ff;
}

.mk-radio-label input[type="radio"] {
    margin-left: 8px;
    cursor: pointer;
}

.mk-radio-label input[type="radio"]:checked + .mk-radio-text {
    color: #1E88E5;
    font-weight: 600;
}

.mk-radio-text {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #495057;
    transition: all 0.3s ease;
}

.mk-radio-text i {
    font-size: 16px;
    display: inline-block !important;
    visibility: visible !important;
}

/* Code Actions */
.mk-code-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
}

.mk-btn-link {
    background: none;
    border: none;
    color: #1E88E5;
    font-size: 13px;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    transition: color 0.3s ease;
}

.mk-btn-link:hover:not(:disabled) {
    color: #1565C0;
}

.mk-btn-link:disabled {
    color: #adb5bd;
    cursor: not-allowed;
    text-decoration: none;
}

.mk-timer {
    font-size: 12px;
    color: #6c757d;
}

/* Buttons */
.mk-form-actions {
    margin-top: 25px;
}

.mk-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    min-height: 48px;
}

.mk-btn-text {
    display: inline-block;
}

.mk-btn-loader {
    display: none;
    position: absolute;
}

.mk-btn-loader i {
    font-size: 18px;
    animation: mkSpin 1s linear infinite;
    display: inline-block !important;
    visibility: visible !important;
}

@keyframes mkSpin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.mk-btn-primary {
    background: linear-gradient(135deg, #1E88E5, #1565C0);
    color: #fff;
}

.mk-btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(30, 136, 229, 0.4);
}

.mk-btn-primary:disabled {
    background: linear-gradient(135deg, #90CAF9, #64B5F6);
    cursor: wait;
}

.mk-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.mk-btn-full {
    width: 100%;
}

/* Messages */
.mk-auth-message {
    margin-top: 15px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    display: none;
}

.mk-auth-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.mk-auth-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.mk-auth-message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Auth Footer */
.mk-auth-footer {
    padding: 20px 30px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    border-radius: 0 0 20px 20px;
    text-align: center;
}

.mk-auth-footer p {
    font-size: 12px;
    color: #6c757d;
    margin: 0;
}

.mk-auth-footer a {
    color: #1E88E5;
    text-decoration: none;
}

.mk-auth-footer a:hover {
    text-decoration: underline;
}

/* User Dropdown */
.mk-user-dropdown {
    position: relative;
}

.mk-user-menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    overflow: hidden;
}

.mk-user-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.mk-user-info {
    padding: 15px 20px;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
}

.mk-user-name {
    font-size: 14px;
    font-weight: 600;
    color: #212529;
}

.mk-user-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    color: #495057;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: right;
    cursor: pointer;
}

.mk-user-menu-item:hover {
    background: #f8f9fa;
    color: #1E88E5;
}

.mk-user-menu-item i {
    font-size: 16px;
    width: 20px;
}

/* Body Lock when modal is open */
body.mk-modal-open {
    overflow: hidden;
}

/* Responsive */
@media (max-width: 768px) {
    .mk-auth-modal-content {
        width: 95%;
        max-height: 95vh;
        border-radius: 15px;
    }
    
    .mk-auth-forms {
        padding: 20px;
    }
    
    .mk-form-header h3 {
        font-size: 20px;
    }
    
    .mk-radio-group {
        flex-direction: column;
    }
    
    .mk-user-menu {
        left: auto;
        right: 0;
    }
}

