/* 
 * FactPack Galaxy Portal - Component Styles
 * Styles for specific UI components and modals
 */

/* User Bar */
.user-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.7) 100%);
    padding: 15px 20px;
    display: none;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    border-bottom: 2px solid transparent;
    border-image: linear-gradient(90deg, #00d4ff, #a55eea, #00d4ff) 1;
    backdrop-filter: blur(10px);
}

body.authenticated .user-bar {
    display: flex;
}

/* Trophy Case */
.trophy-case {
    position: fixed;
    right: 20px;
    top: 120px;
    display: none;
    flex-direction: column;
    gap: 10px;
    z-index: 50;
}

body.authenticated .trophy-case {
    display: flex;
}

.trophy {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
    opacity: 0.3;
    transition: all 0.3s ease;
    cursor: pointer;
}

.trophy.earned {
    opacity: 1;
    animation: trophyGlow 2s ease-in-out infinite alternate;
}

@keyframes trophyGlow {
    from { box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4); }
    to { box-shadow: 0 4px 25px rgba(255, 215, 0, 0.8); }
}

/* Memorial Star */
.hidden-star {
    position: fixed;
    top: 150px;
    right: 150px;
    width: 4px;
    height: 4px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.9),
                0 0 40px rgba(255, 215, 0, 0.5);
    animation: specialTwinkle 6s ease-in-out infinite;
    cursor: pointer;
    z-index: 1000;
    display: none;
}

body.authenticated .hidden-star {
    display: block;
}

@keyframes specialTwinkle {
    0%, 100% { 
        opacity: 0.6; 
        transform: scale(1);
        box-shadow: 0 0 20px rgba(255, 255, 255, 0.9),
                    0 0 40px rgba(255, 215, 0, 0.5);
    }
    50% { 
        opacity: 1; 
        transform: scale(1.5);
        box-shadow: 0 0 30px rgba(255, 255, 255, 1),
                    0 0 60px rgba(255, 215, 0, 0.7);
    }
}

/* Modal Overlays */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-container {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 25px;
    padding: 40px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    text-align: center;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    border: 2px solid #00d4ff;
}

.close-btn {
    background: none;
    border: none;
    color: #00d4ff;
    font-size: 24px;
    cursor: pointer;
    position: absolute;
    top: 10px;
    right: 15px;
    transition: color 0.3s ease;
}

.close-btn:hover {
    color: #ffffff;
}

/* Memorial Modal */
#meghanModal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
}

#meghanModal .modal-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    margin: 15% auto;
    padding: 40px;
    border-radius: 15px;
    width: 80%;
    max-width: 400px;
    text-align: center;
    border: 2px solid #FFD700;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.3);
    position: relative;
}

#meghanModal .close {
    color: #FFD700;
    position: absolute;
    right: 15px;
    top: 10px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.glitter-text {
    font-size: 2.5rem;
    background: linear-gradient(45deg, #FFD700, #FFA500, #FFD700);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gentleGlow 3s ease-in-out infinite;
    font-family: 'Georgia', serif;
    margin: 10px 0;
}

@keyframes gentleGlow {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* World Info Popup */
.world-info-popup {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 2px solid #00d4ff;
    border-radius: 15px;
    padding: 20px;
    max-width: 400px;
    color: white;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.world-title {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #00d4ff;
    text-align: center;
}

.world-description {
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 20px;
    text-align: center;
    opacity: 0.9;
}

.world-status {
    background: rgba(255, 165, 0, 0.2);
    border: 1px solid #ffa502;
    border-radius: 8px;
    padding: 8px 12px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 12px;
    color: #ffa502;
    font-weight: 600;
}

.locked-status {
    background: rgba(128, 128, 128, 0.2);
    border: 1px solid #888;
    color: #999;
}

.popup-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 20px;
}

.single-button {
    grid-template-columns: 1fr;
}

.popup-btn {
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.demo-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
}

.demo-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.5);
    text-decoration: none;
    color: white;
}

.buy-btn {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    color: #8b4513;
    box-shadow: 0 2px 10px rgba(252, 182, 159, 0.3);
}

.buy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(252, 182, 159, 0.5);
}

.close-popup-btn {
    grid-column: 1 / -1;
    background: transparent;
    border: 1px solid #666;
    color: #999;
    margin-top: 10px;
}

.close-popup-btn:hover {
    border-color: #999;
    color: #ccc;
    transform: none;
    box-shadow: none;
}

/* Parent Dashboard */
.parent-dashboard {
    display: none;
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 90;
    padding: 20px;
    overflow-y: auto;
}

body.parent-mode .parent-dashboard {
    display: block;
}

/* Parent Button Grid */
.parent-button-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 10px 0;
    width: 100%;
    max-width: 600px;
}

.parent-action-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    cursor: pointer;
    text-align: center;
    justify-content: center;
}

.factpack-store-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.parent-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
    text-decoration: none;
    color: white;
}

.parent-action-btn:active {
    transform: translateY(0);
}

.add-coins-btn {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    box-shadow: 0 4px 15px rgba(252, 182, 159, 0.4);
}

.add-coins-btn:hover {
    box-shadow: 0 6px 20px rgba(252, 182, 159, 0.6);
}

.watch-stats-btn {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    box-shadow: 0 4px 15px rgba(168, 237, 234, 0.4);
}

.watch-stats-btn:hover {
    box-shadow: 0 6px 20px rgba(168, 237, 234, 0.6);
}

.return-portal-btn {
    background: linear-gradient(135deg, #d299c2 0%, #fef9d7 100%);
    box-shadow: 0 4px 15px rgba(210, 153, 194, 0.4);
    margin-top: 10px;
}

.return-portal-btn:hover {
    box-shadow: 0 6px 20px rgba(210, 153, 194, 0.6);
}

.store-icon {
    font-size: 18px;
}

.logout-link:hover {
    color: #00d4ff !important;
    text-decoration: underline !important;
}

.logout-link:active {
    color: #ff6b6b !important;
}

/* Hide logout link in demo mode */
.demo-mode .logout-link {
    display: none;
}

/* Parent Auth Modal */
.parent-auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.parent-auth-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 2px solid #00d4ff;
    border-radius: 15px;
    padding: 30px;
    color: white;
    text-align: center;
    max-width: 350px;
}

.auth-title {
    font-size: 18px;
    margin-bottom: 15px;
    color: #00d4ff;
}

.auth-input {
    width: 100%;
    padding: 10px;
    margin: 8px 0;
    border: 1px solid #444;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 14px;
}

.auth-btn {
    padding: 10px 20px;
    margin: 5px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

.auth-confirm {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.auth-cancel {
    background: transparent;
    border: 1px solid #666;
    color: #999;
}

/* Trophy Modal */
.trophy-galaxy-container {
    position: relative; 
    flex-shrink: 0;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border: 2px solid #ffd700;
    border-radius: 15px;
    width: 95%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 20px;
}

.trophy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 15px;
    margin: 15px 0;
}

.trophy-item {
    text-align: center;
    padding: 15px;
    border-radius: 10px;
    background: rgba(255, 215, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.trophy-item.earned {
    background: rgba(255, 215, 0, 0.3);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
    animation: trophyGlow 2s ease-in-out infinite alternate;
}

.trophy-item.locked {
    opacity: 0.4;
    filter: grayscale(1);
}

.trophy-item img {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

.trophy-earned {
    animation: trophyEarn 3s ease-out forwards;
}

@keyframes trophyEarn {
    0% { 
        opacity: 0; 
        transform: translate(-50%, -50%) scale(0.5) rotate(-180deg); 
    }
    50% { 
        opacity: 1; 
        transform: translate(-50%, -50%) scale(1.2) rotate(0deg); 
    }
    100% { 
        opacity: 0; 
        transform: translate(-50%, -50%) scale(1) rotate(0deg); 
    }
}

/* Contact Form Styling */
#contactFormContainer .wpforms-field-container {
    margin: 0;
}

#contactFormContainer .wpforms-field {
    margin-bottom: 20px;
}

#contactFormContainer .wpforms-field-label {
    display: block;
    margin-bottom: 8px;
    color: #00d4ff;
    font-weight: 600;
    font-size: 14px;
}

#contactFormContainer .wpforms-field-description,
#contactFormContainer .wpforms-field-sublabel,
#contactFormContainer p {
    color: #ccc;
    font-size: 13px;
    line-height: 1.5;
}

#contactFormContainer input[type="text"],
#contactFormContainer input[type="email"],
#contactFormContainer textarea,
#contactFormContainer select {
    width: 100%;
    padding: 12px;
    border: 1px solid #444;
    border-radius: 8px;
    background: rgba(26, 26, 46, 0.8);
    color: white;
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

#contactFormContainer input:focus,
#contactFormContainer textarea:focus,
#contactFormContainer select:focus {
    outline: none;
    border-color: #00d4ff;
    box-shadow: 0 0 0 2px rgba(0, 212, 255, 0.2);
}

#contactFormContainer textarea {
    min-height: 120px;
    resize: vertical;
}

#contactFormContainer .wpforms-submit {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#contactFormContainer .wpforms-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

#contactFormContainer .wpforms-required-label {
    color: #ff6b6b;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .modal-container {
        padding: 20px;
        margin: 10px;
    }
    
    .parent-action-btn {
        width: 100%;
        justify-content: center;
        padding: 15px 20px;
    }
    
    .trophy-galaxy-container {
        width: 95%;
        padding: 15px;
    }
    
    .trophy-grid {
        grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
        gap: 10px;
    }
    
    .trophy-item img {
        width: 40px;
        height: 40px;
    }
}

@media (min-width: 768px) {
    .trophy-galaxy-container {
        width: 80%;
        padding: 30px;
    }
    
    .trophy-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 20px;
    }
    
    .trophy-item img {
        width: 80px;
        height: 80px;
    }
}