/* css/modal.css - 邀請碼彈窗樣式 */

/* ========== 彈窗遮罩 ========== */
.invitation-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    z-index: 99999;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease-out;
}

.invitation-modal-overlay.active {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ========== 彈窗內容 ========== */
.invitation-modal-content {
    background: rgba(31, 31, 31, 0.98);
    border: 2px solid rgba(59, 130, 246, 0.5);
    border-radius: 20px;
    padding: 40px;
    max-width: 600px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    animation: slideUp 0.3s ease-out;
    position: relative;
}

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

/* ========== 彈窗標題 ========== */
.invitation-modal-header {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 25px;
    background: linear-gradient(135deg, #ffffff, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
}

/* ========== 彈窗內容區 ========== */
.invitation-modal-body {
    color: #d0d0d0;
    font-size: 16px;
    line-height: 1.8;
    margin-bottom: 30px;
}

.invitation-modal-body p {
    margin-bottom: 15px;
}

.invitation-modal-link {
    color: #3b82f6;
    text-decoration: none;
    word-break: break-all;
}

.invitation-modal-link:hover {
    color: #60a5fa;
    text-decoration: underline;
}

/* ========== 邀請碼輸入區 ========== */
.invitation-code-section {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
}

.invitation-code-label {
    color: #60a5fa;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 10px;
    display: block;
}

.invitation-code-input {
    width: 100%;
    padding: 12px 16px;
    background: #1a1a1a;
    border: 2px solid #3a3a3a;
    border-radius: 8px;
    color: #e0e0e0;
    font-size: 16px;
    font-family: monospace;
    text-transform: uppercase;
    transition: all 0.3s;
}

.invitation-code-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.invitation-code-input.error {
    border-color: #ef4444;
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.invitation-code-hint {
    color: #7a7a7a;
    font-size: 12px;
    margin-top: 8px;
}

/* ========== 錯誤訊息 ========== */
.invitation-error-msg {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    display: none;
    text-align: center;
}

/* ========== 彈窗按鈕 ========== */
.invitation-modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.invitation-modal-btn {
    padding: 14px 28px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.invitation-modal-btn-primary {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: white;
    box-shadow: 0 5px 20px rgba(59, 130, 246, 0.3);
}

.invitation-modal-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.5);
}

.invitation-modal-btn-secondary {
    background: transparent;
    color: #b0b0b0;
    border: 2px solid rgba(176, 176, 176, 0.5);
}

.invitation-modal-btn-secondary:hover {
    background: rgba(176, 176, 176, 0.1);
    border-color: rgba(176, 176, 176, 0.8);
    color: #ffffff;
}

.invitation-modal-btn-verify {
    background: linear-gradient(135deg, #22c55e, #10b981);
    color: white;
    box-shadow: 0 5px 20px rgba(34, 197, 94, 0.3);
    width: 100%;
    justify-content: center;
    margin-bottom: 15px;
}

.invitation-modal-btn-verify:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(34, 197, 94, 0.5);
}

.invitation-modal-btn-verify:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ========== 彈窗語言選擇器 ========== */
.modal-language-selector {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10;
}

.modal-lang-btn {
    background: rgba(42, 42, 42, 0.8);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 8px;
    padding: 6px 12px;
    color: #e0e0e0;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    transition: all 0.2s;
}

.modal-lang-btn:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.5);
}

.modal-lang-flag {
    font-size: 16px;
}

.modal-lang-arrow {
    font-size: 8px;
    transition: transform 0.3s;
}

.modal-language-selector.active .modal-lang-arrow {
    transform: rotate(180deg);
}

.modal-lang-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: rgba(31, 31, 31, 0.98);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 8px;
    min-width: 180px;
    max-height: 300px;
    overflow-y: auto;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.modal-language-selector.active .modal-lang-dropdown {
    display: block;
}

.modal-lang-option {
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: background 0.2s;
    color: #d0d0d0;
    font-size: 13px;
}

.modal-lang-option:hover {
    background: rgba(59, 130, 246, 0.2);
}

.modal-lang-option.active {
    background: rgba(59, 130, 246, 0.3);
    color: #60a5fa;
}

.modal-lang-check {
    margin-left: auto;
    color: #22c55e;
    font-weight: bold;
}

/* ========== 響應式設計 ========== */
@media (max-width: 768px) {
    .invitation-modal-content {
        padding: 20px 16px;
        padding-top: 50px;
        max-height: 95vh;
        overflow-y: auto;
    }
    
    .modal-language-selector {
        top: 12px;
        right: 12px;
    }
    
    .modal-lang-btn {
        padding: 5px 10px;
        font-size: 12px;
    }
    
    .modal-lang-flag {
        font-size: 14px;
    }
    
    .modal-lang-name {
        display: none;
    }
    
    .invitation-modal-header {
        font-size: 22px;
        margin-bottom: 16px;
    }
    
    .invitation-modal-body {
        font-size: 14px;
        margin-bottom: 20px;
        line-height: 1.6;
    }
    
    .invitation-modal-body p {
        margin-bottom: 10px;
    }
    
    .invitation-code-section {
        padding: 15px;
        margin-bottom: 18px;
    }
    
    .invitation-code-input {
        padding: 10px 14px;
        font-size: 15px;
    }
    
    .invitation-modal-btn-verify {
        padding: 10px 20px;
        font-size: 14px;
        margin-bottom: 10px;
    }
    
    .invitation-modal-buttons {
        flex-direction: column;
        gap: 8px;
    }
    
    .invitation-modal-btn {
        width: 100%;
        justify-content: center;
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .invitation-error-msg {
        padding: 10px;
        margin-bottom: 15px;
        font-size: 13px;
    }
}
