/* ========================================
   FRACTALLA - Modals
   Share Modal, Leaderboard, Overlays
   ======================================== */

/* ========================================
   MODALS - Mystical Glass Design
   ======================================== */
.modal {
    display: flex;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal.hidden {
    display: none;
    opacity: 0;
}

.modal-content {
    background: black;
    backdrop-filter: blur(40px) saturate(180%);
    border: 2px solid transparent;
    background-clip: padding-box;
    border-radius: 24px;
    padding: 3rem 2.5rem;
    width: 90%;
    max-width: 520px;
    box-shadow:
        0 20px 80px rgba(0, 0, 0, 0.9),
        0 0 0 1px rgba(25, 242, 255, 0.1) inset,
        0 0 60px rgba(167, 139, 250, 0.3),
        0 0 100px rgba(25, 242, 255, 0.2);
    text-align: center;
    position: relative;
    color: var(--divine-white);
    animation: modalSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-content::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 24px;
    padding: 2px;
    background: linear-gradient(135deg, rgba(25, 242, 255, 0.5), rgba(167, 139, 250, 0.5), rgba(240, 171, 252, 0.5));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    color: rgba(255, 255, 255, 0.5);
    font-size: 28px;
    font-weight: 300;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close-modal:hover {
    color: var(--aurora-cyan);
    background: rgba(25, 242, 255, 0.1);
    transform: rotate(90deg);
}

.modal-content h2 {
    font-family: 'Rajdhani', sans-serif;
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 0.8rem;
    background: var(--gradient-aurora);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 40px rgba(25, 242, 255, 0.3);
    position: relative;
    padding-bottom: 1rem;
}

.modal-content h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 2px;
    background: var(--gradient-aurora);
    box-shadow: 0 0 20px rgba(25, 242, 255, 0.6);
}

.modal-content p {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 2rem;
    font-weight: 300;
    font-size: 0.95rem;
}

/* ========================================
   SHARE MODAL
   ======================================== */
.share-input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 2rem;
}

#share-url {
    flex: 1;
    padding: 14px 18px;
    border-radius: 12px;
    border: 2px solid rgba(167, 139, 250, 0.3);
    background: rgba(0, 0, 0, 0.6);
    color: var(--aurora-cyan);
    font-family: monospace;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    font-weight: 500;
}

#share-url:focus {
    outline: none;
    border-color: var(--aurora-cyan);
    background: rgba(0, 0, 0, 0.8);
    box-shadow: 0 0 25px rgba(25, 242, 255, 0.3), 0 0 50px rgba(25, 242, 255, 0.1);
}

#copy-btn {
    padding: 14px 20px;
    border-radius: 12px;
    border: 2px solid rgba(25, 242, 255, 0.4);
    background: rgba(25, 242, 255, 0.15);
    color: var(--aurora-cyan);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-size: 1.2rem;
    box-shadow: 0 0 20px rgba(25, 242, 255, 0.2);
    min-width: 60px;
}

#copy-btn:hover {
    background: rgba(25, 242, 255, 0.25);
    border-color: var(--aurora-cyan);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 5px 30px rgba(25, 242, 255, 0.4), 0 0 40px rgba(25, 242, 255, 0.3);
}

#copy-btn:active {
    transform: translateY(-1px) scale(0.98);
}

/* Social Buttons */
.social-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.social-btn {
    padding: 12px 24px;
    border-radius: 12px;
    text-decoration: none;
    color: var(--divine-white);
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
    font-family: 'Outfit', sans-serif;
}

.social-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), transparent);
    transition: opacity 0.3s ease;
}

.social-btn:hover::before {
    opacity: 1;
}

.social-btn:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.social-btn:active {
    transform: translateY(-2px) scale(1.02);
}

.whatsapp {
    background: linear-gradient(135deg, #25D366, #128C7E);
    border-color: rgba(37, 211, 102, 0.3);
}

.whatsapp:hover {
    box-shadow: 0 10px 30px rgba(37, 211, 102, 0.4);
}

.facebook {
    background: linear-gradient(135deg, #1877F2, #0e5fcc);
    border-color: rgba(24, 119, 242, 0.3);
}

.facebook:hover {
    box-shadow: 0 10px 30px rgba(24, 119, 242, 0.4);
}

.twitter {
    background: linear-gradient(135deg, #1a1a1a, #000000);
    border-color: rgba(255, 255, 255, 0.3);
}

.twitter:hover {
    box-shadow: 0 10px 30px rgba(255, 255, 255, 0.2);
}

.email {
    background: linear-gradient(135deg, #EA4335, #c33527);
    border-color: rgba(234, 67, 53, 0.3);
}

.email:hover {
    box-shadow: 0 10px 30px rgba(234, 67, 53, 0.4);
}

/* Publish Section */
.publish-section {
    display: none; /* Hidden until feature is ready */
    margin-top: 2.5rem;
    padding-top: 2.5rem;
    border-top: 1px solid rgba(167, 139, 250, 0.2);
    position: relative;
}

.publish-section::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--aurora-cyan), transparent);
    box-shadow: 0 0 20px rgba(25, 242, 255, 0.5);
}

.publish-section hr {
    display: none;
}

.publish-section p {
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.publish-input-group {
    display: flex;
    gap: 12px;
    margin-top: 1rem;
}

#publish-name {
    flex: 1;
    padding: 14px 18px;
    border-radius: 12px;
    border: 2px solid rgba(167, 139, 250, 0.3);
    background: rgba(0, 0, 0, 0.6);
    color: var(--divine-white);
    font-size: 0.95rem;
    font-family: 'Outfit', sans-serif;
    transition: all 0.3s ease;
}

#publish-name::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

#publish-name:focus {
    outline: none;
    border-color: var(--spirit-purple);
    background: rgba(0, 0, 0, 0.8);
    box-shadow: 0 0 25px rgba(167, 139, 250, 0.3), 0 0 50px rgba(167, 139, 250, 0.1);
}

.primary-btn {
    padding: 14px 28px;
    border-radius: 12px;
    border: 2px solid transparent;
    background: var(--gradient-aurora);
    color: var(--divine-white);
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 5px 25px rgba(25, 242, 255, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.85rem;
    white-space: nowrap;
}

.primary-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 40px rgba(25, 242, 255, 0.5), 0 0 60px rgba(167, 139, 250, 0.3);
    border-color: rgba(25, 242, 255, 0.3);
}

.primary-btn:active {
    transform: translateY(-1px) scale(0.98);
}

/* ========================================
   LEADERBOARD MODAL
   ======================================== */
.large-modal {
    max-width: 900px;
    width: 95%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    padding: 2rem;
}

.leaderboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    overflow-y: auto;
    padding: 10px;
    flex: 1;
}

.mandala-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(167, 139, 250, 0.2);
    border-radius: 12px;
    padding: 15px;
    text-align: left;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mandala-card:hover {
    transform: translateY(-5px);
    background: rgba(167, 139, 250, 0.08);
    border-color: var(--aurora-cyan);
    box-shadow: var(--glow-purple);
}

.mandala-name {
    font-weight: 600;
    color: var(--divine-white);
    font-size: 1.1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mandala-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
}

.vote-btn {
    background: none;
    border: none;
    color: var(--celestial-gold);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 5px;
    transition: all 0.3s ease;
    border-radius: 50%;
}

.vote-btn:hover {
    transform: scale(1.3) rotate(20deg);
    text-shadow: var(--glow-gold);
}

.vote-count {
    font-weight: 600;
    color: var(--celestial-gold);
}

/* Loading */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

.loading::after {
    content: "";
    width: 60px;
    height: 60px;
    border: 3px solid transparent;
    border-top-color: var(--aurora-cyan);
    border-right-color: var(--spirit-purple);
    border-radius: 50%;
    animation: cosmicSpin 1.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
    filter: drop-shadow(var(--glow-cyan));
}

/* ========================================
   CONTACT MODAL
   ======================================== */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    text-align: left;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-label {
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--aurora-cyan);
    text-shadow: 0 0 8px rgba(25, 242, 255, 0.3);
}

.form-label .required {
    color: var(--ether-pink);
    margin-left: 2px;
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
    padding: 14px 18px;
    border-radius: 12px;
    border: 2px solid rgba(167, 139, 250, 0.3);
    background: rgba(0, 0, 0, 0.6);
    color: var(--divine-white);
    font-size: 0.95rem;
    font-family: 'Outfit', sans-serif;
    transition: all 0.3s ease;
    resize: vertical;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--aurora-cyan);
    background: rgba(0, 0, 0, 0.8);
    box-shadow: 0 0 25px rgba(25, 242, 255, 0.3), 0 0 50px rgba(25, 242, 255, 0.1);
}

.contact-form textarea {
    min-height: 120px;
    max-height: 300px;
}

.captcha-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0.5rem 0;
}

.form-actions {
    display: flex;
    justify-content: center;
    margin-top: 0.5rem;
}

.contact-submit-btn {
    padding: 14px 32px;
    border-radius: 12px;
    border: 2px solid transparent;
    background: var(--gradient-aurora);
    color: var(--divine-white);
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 5px 25px rgba(25, 242, 255, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.contact-submit-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 40px rgba(25, 242, 255, 0.5), 0 0 60px rgba(167, 139, 250, 0.3);
    border-color: rgba(25, 242, 255, 0.3);
}

.contact-submit-btn:active {
    transform: translateY(-1px) scale(0.98);
}

.contact-submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.contact-status {
    padding: 12px 18px;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
    font-size: 0.9rem;
    margin-top: 1rem;
    animation: fadeIn 0.3s ease;
}

.contact-status.success {
    background: rgba(37, 211, 102, 0.15);
    border: 1px solid rgba(37, 211, 102, 0.3);
    color: #25D366;
}

.contact-status.error {
    background: rgba(234, 67, 53, 0.15);
    border: 1px solid rgba(234, 67, 53, 0.3);
    color: #EA4335;
}
