/* ==========================================================================
   ZTI USER AUTHENTICATION UI
   Styling for login button, modal, and user menu
   ========================================================================== */

/* --- AUTH CONTAINER IN HEADER --- */
.zti-auth-container {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    margin-left: auto;
    margin-right: 10px;
}

/* --- LOGIN BUTTON --- */
.zti-login-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: transparent;
    border: 1px solid #00ffff66;
    color: #00ffff;
    font-family: 'VT323', monospace;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.zti-login-btn:hover {
    background: rgba(0, 255, 255, 0.1);
    border-color: #00ffff;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
    text-shadow: 0 0 5px #00ffff;
}

.zti-login-icon {
    color: #00ff00;
}

/* --- USER MENU (LOGGED IN STATE) --- */
.zti-user-menu {
    position: relative;
}

.zti-user-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    background: rgba(0, 50, 50, 0.5);
    border: 1px solid #00ff0066;
    color: #aaffaa;
    font-family: 'VT323', monospace;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.zti-user-btn:hover {
    background: rgba(0, 100, 50, 0.5);
    border-color: #00ff00;
}

.zti-user-icon {
    color: #00ff00;
    text-shadow: 0 0 5px #00ff00;
}

.zti-user-name {
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.zti-dropdown-arrow {
    font-size: 0.7rem;
    margin-left: 4px;
    transition: transform 0.2s ease;
}

.zti-user-btn:hover .zti-dropdown-arrow {
    transform: translateY(2px);
}

/* --- DROPDOWN MENU --- */
.zti-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 160px;
    background: rgba(10, 20, 20, 0.98);
    border: 1px solid #00ffff66;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    margin-top: 5px;
}

.zti-dropdown.hidden {
    display: none;
}

.zti-dropdown-item {
    display: block;
    width: 100%;
    padding: 8px 12px;
    background: transparent;
    border: none;
    border-bottom: 1px solid #00ffff22;
    color: #aaffee;
    font-family: 'VT323', monospace;
    font-size: 0.9rem;
    text-decoration: none;
    text-align: left;
    cursor: pointer;
    transition: all 0.15s ease;
}

.zti-dropdown-item:last-child {
    border-bottom: none;
}

.zti-dropdown-item:hover {
    background: rgba(0, 255, 255, 0.1);
    color: #00ffff;
    padding-left: 16px;
}

.zti-logout-btn {
    color: #ffaaaa;
}

.zti-logout-btn:hover {
    background: rgba(255, 100, 100, 0.1);
    color: #ff6666;
}

/* --- LOGIN MODAL --- */
.zti-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.zti-modal.hidden {
    display: none;
}

.zti-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(3px);
}

.zti-modal-content {
    position: relative;
    width: min(450px, 95vw);
    max-height: 90vh;
    background: linear-gradient(180deg, rgba(10, 25, 25, 0.98) 0%, rgba(5, 15, 15, 0.99) 100%);
    border: 2px solid #00ffff;
    box-shadow: 
        0 0 30px rgba(0, 255, 255, 0.3),
        inset 0 0 30px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.zti-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
    background: linear-gradient(180deg, #0a1a1a 0%, #051515 100%);
    border-bottom: 1px solid #00ffff44;
}

.zti-modal-title {
    color: #00aaaa;
    font-family: 'VT323', monospace;
    font-size: 1rem;
    letter-spacing: 1px;
}

.zti-modal-close {
    background: transparent;
    border: 1px solid #ff444444;
    color: #ff4444;
    font-family: 'VT323', monospace;
    font-size: 0.8rem;
    padding: 2px 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.zti-modal-close:hover {
    background: rgba(255, 68, 68, 0.15);
    border-color: #ff4444;
}

.zti-modal-body {
    padding: 20px;
}

.zti-modal-info {
    color: #aaffaa;
    font-family: 'VT323', monospace;
    font-size: 0.95rem;
    margin-bottom: 20px;
    padding: 8px;
    border-left: 3px solid #00ff00;
    background: rgba(0, 255, 0, 0.05);
}

/* --- LOGIN FORM --- */
.zti-form-group {
    margin-bottom: 15px;
}

.zti-form-group label {
    display: block;
    color: #88aaaa;
    font-family: 'VT323', monospace;
    font-size: 0.9rem;
    margin-bottom: 5px;
    letter-spacing: 1px;
}

.zti-form-group input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    background: rgba(0, 20, 20, 0.9);
    border: 1px solid #005555;
    border-left: 3px solid #008888;
    color: #aaffee;
    font-family: 'VT323', monospace;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.zti-form-group input[type="text"]:focus {
    outline: none;
    border-color: #00ffff;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.2);
}

.zti-form-group input[type="text"]::placeholder {
    color: #446666;
}

/* Checkbox styling */
.zti-checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: #aaaaaa;
}

.zti-checkbox-group input[type="checkbox"] {
    appearance: none;
    width: 16px;
    height: 16px;
    border: 1px solid #00ffff66;
    background: rgba(0, 20, 20, 0.9);
    cursor: pointer;
    position: relative;
}

.zti-checkbox-group input[type="checkbox"]:checked {
    background: rgba(0, 255, 255, 0.2);
    border-color: #00ffff;
}

.zti-checkbox-group input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #00ffff;
    font-size: 12px;
}

/* --- STATUS MESSAGE --- */
.zti-status {
    min-height: 24px;
    padding: 8px;
    font-family: 'VT323', monospace;
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.zti-status.pending {
    color: #ffff88;
    border-left: 3px solid #ffff00;
    background: rgba(255, 255, 0, 0.05);
}

.zti-status.success {
    color: #88ff88;
    border-left: 3px solid #00ff00;
    background: rgba(0, 255, 0, 0.05);
}

.zti-status.error {
    color: #ff8888;
    border-left: 3px solid #ff4444;
    background: rgba(255, 0, 0, 0.05);
}

/* --- SUBMIT BUTTON --- */
.zti-submit-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(180deg, rgba(0, 80, 80, 0.8) 0%, rgba(0, 50, 50, 0.9) 100%);
    border: 1px solid #00ffff;
    color: #00ffff;
    font-family: 'VT323', monospace;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.zti-submit-btn:hover:not(:disabled) {
    background: linear-gradient(180deg, rgba(0, 100, 100, 0.9) 0%, rgba(0, 70, 70, 0.95) 100%);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
}

.zti-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    .zti-auth-container {
        margin-right: 5px;
    }
    
    .zti-login-btn {
        padding: 5px 8px;
        font-size: 0.85rem;
    }
    
    .zti-login-text {
        display: none;
    }
    
    .zti-login-icon {
        font-size: 1.1rem;
    }
    
    .zti-user-name {
        display: none;
    }
    
    .zti-dropdown-arrow {
        display: none;
    }
    
    .zti-user-icon {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .zti-modal-content {
        width: 100vw;
        height: 100vh;
        max-height: 100vh;
        border: none;
        border-radius: 0;
    }
    
    .zti-modal-body {
        padding: 15px;
    }
}
