.spell-circle-small {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 0 auto var(--space-lg);
}

.spell-circle-small .circle-outer,
.spell-circle-small .circle-middle,
.spell-circle-small .circle-inner {
    position: absolute;
    border-radius: 50%;
    border: 2px solid var(--spell-gold);
    opacity: 0.6;
}

.spell-circle-small .circle-outer {
    width: 200px;
    height: 200px;
    top: 0;
    left: 0;
    animation: rotate-slow 20s linear infinite;
    box-shadow: 0 0 20px var(--glow-effect);
}

.spell-circle-small .circle-middle {
    width: 140px;
    height: 140px;
    top: 30px;
    left: 30px;
    animation: rotate-slow 15s linear infinite reverse;
}

.spell-circle-small .circle-inner {
    width: 80px;
    height: 80px;
    top: 60px;
    left: 60px;
    animation: rotate-slow 10s linear infinite;
    background: radial-gradient(circle, var(--glow-effect), transparent);
}

/* ─────────────────────────────────────────────────────────────── */
/* UPLOAD CARD STYLING */
/* ─────────────────────────────────────────────────────────────── */
.upload-form {
    max-width: 600px;
    margin: 0 auto;
}

.upload-card {
    background: rgba(61, 41, 82, 0.4);
    backdrop-filter: blur(10px);
    border: 2px solid var(--ethereal-lavender);
    border-radius: 12px;
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
    transition: all 0.4s ease;
}

.upload-card:hover {
    border-color: var(--spell-gold);
    box-shadow: 0 12px 40px var(--shadow-deep), 0 0 30px var(--glow-effect);
}

.upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    gap: var(--space-sm);
}

.upload-label input[type="file"] {
    display: none;
}

.upload-icon {
    font-size: 2.5rem;
    color: var(--spell-gold);
}

.upload-text {
    color: var(--frost-white);
    font-size: 1.1rem;
    letter-spacing: 0.05em;
}

/* ─────────────────────────────────────────────────────────────── */
/* UPLOAD BUTTON */
/* ─────────────────────────────────────────────────────────────── */
.upload-button {
    position: relative;
    padding: 0.8rem 1.5rem;
    background: linear-gradient(135deg, #8b2e3d, #c44569);
    border: 2px solid #ff6b81;
    border-radius: 8px;
    color: var(--frost-white);
    font-size: 1.1rem;
    font-family: 'Georgia', serif;
    letter-spacing: 0.1em;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.4s ease;
}

.upload-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(255, 107, 129, 0.6), transparent);
    transform: translate(-50%, -50%);
    transition: all 0.6s ease;
    border-radius: 50%;
}

.upload-button:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, #c44569, #ff6b81);
    box-shadow: 0 8px 25px rgba(255, 107, 129, 0.5), 0 0 30px rgba(255, 107, 129, 0.3);
}

.upload-button:hover::before {
    width: 300px;
    height: 300px;
}

.upload-button:active {
    transform: translateY(0);
}

/* ─────────────────────────────────────────────────────────────── */
/* WALLPAPER GALLERY - RESPONSIVE 5-COLUMN BRICK LAYOUT */
/* ─────────────────────────────────────────────────────────────── */
.wallpaper-gallery {
    margin-top: var(--space-xl);
    padding: 0 20px;
}

.spell-grid {
    display: block;
    column-count: 5;
    column-gap: 15px;
    width: 100%;
}

.wallpaper-card {
    break-inside: avoid;
    display: inline-block;
    width: 100%;
    margin-bottom: 15px;

    background: rgba(61, 41, 82, 0.4);
    backdrop-filter: blur(10px);
    border: 2px solid var(--ethereal-lavender);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.4s ease;
    position: relative;
}

.wallpaper-card:hover {
    border-color: var(--spell-gold);
    box-shadow: 0 12px 40px var(--shadow-deep), 0 0 30px var(--glow-effect);
    transform: translateY(-4px);
}

/* ─────────────────────────────────────────────────────────────── */
/* IMAGE CONTAINER WITH OVERLAY */
/* ─────────────────────────────────────────────────────────────── */
.wallpaper-image-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    display: block;
    cursor: pointer;
}

.wallpaper-image {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.4s ease;
}

.wallpaper-card:hover .wallpaper-image {
    transform: scale(1.05);
}

/* ─────────────────────────────────────────────────────────────── */
/* OVERLAY WITH INFO AND ACTIONS */
/* ─────────────────────────────────────────────────────────────── */
.wallpaper-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
            to bottom,
            rgba(45, 27, 61, 0.2) 0%,
            rgba(45, 27, 61, 0.6) 40%,
            rgba(45, 27, 61, 0.95) 85%
    );
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: var(--space-sm);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.wallpaper-card:hover .wallpaper-overlay {
    opacity: 1;
}

.wallpaper-info {
    text-align: center;
    transform: translateY(-10px);
    transition: transform 0.4s ease 0.1s;
}

.wallpaper-card:hover .wallpaper-info {
    transform: translateY(0);
}

.wallpaper-info h3 {
    color: var(--frost-white);
    font-size: 0.95rem; /* Slightly smaller for 5-column layout */
    margin-bottom: 2px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
    word-wrap: break-word;
}

.upload-date {
    font-size: 0.7rem;
    color: var(--ethereal-lavender);
}

.wallpaper-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 18px;
    transform: translateY(10px);
    transition: transform 0.4s ease 0.15s;
}

.wallpaper-card:hover .wallpaper-actions {
    transform: translateY(0);
}

.action-button {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border-radius: 6px;
    font-size: 0.75rem;
    color: var(--frost-white);
    background: rgba(61, 41, 82, 0.9);
    border: 1px solid var(--ethereal-lavender);
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    flex: none;
    width: 36px;
    height: 36px;
    box-sizing: border-box;
}


.action-button .button-label {
    display: none;
}

.action-button .button-icon {
    font-size: 1.1rem;
}

.action-button:hover {
    background: rgba(184, 169, 212, 0.3);
    border-color: var(--spell-gold);
}



/* ─────────────────────────────────────────────────────────────── */
/* RESPONSIVE DESIGN - BREAKPOINTS */
/* ─────────────────────────────────────────────────────────────── */

/* Desktop/Large Screens (1400px+) - 5 Columns */
@media (min-width: 1400px) {
    .spell-grid { column-count: 4; }
}

/* Standard Laptops (1100px - 1399px) - 4 Columns */
@media (max-width: 1399px) {
    .spell-grid { column-count: 3; }
}

/* Tablets / Small Laptops (768px - 1099px) - 3 Columns */
@media (max-width: 1099px) {
    .spell-grid { column-count: 3; }
}

/* Large Phones / Tablets (480px - 767px) - 2 Columns */
@media (max-width: 767px) {
    .spell-grid { column-count: 2; }

    .wallpaper-overlay {
        opacity: 1;
        background: linear-gradient(to bottom, transparent, rgba(45, 27, 61, 0.9));
    }
    .wallpaper-info, .wallpaper-actions { transform: translateY(0); }
}

/* Phones (Below 480px) - 1 Column */
@media (max-width: 480px) {
    .spell-grid { column-count: 1; }
}

.wallpaper-image {
    transform: scale(1.24);
}

.wallpaper-card {
    margin-bottom: 10px;
    border-width: 1.5px;
}

.wallpaper-overlay {
    padding: 6px;
}


/* ─────────────────────────────────────────────────────────────── */
/* TITLES & KEYFRAMES */
/* ─────────────────────────────────────────────────────────────── */
.section-title {
    text-align: center;
    font-size: 1.8rem;
    color: var(--frost-white);
    margin: var(--space-xl) 0 var(--space-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
}

.title-line {
    flex: 1;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--ethereal-lavender), transparent);
    max-width: 200px;
}

@keyframes rotate-slow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ═══════════════════════════════════════════════════════════════
   WALLPAPER MODAL - LIGHTBOX WITH COMMENTS
   ═══════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────────────────────── */
/* MODAL OVERLAY & CONTAINER */
/* ─────────────────────────────────────────────────────────────── */
.wallpaper-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.wallpaper-modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(18, 10, 28, 0.95);
    backdrop-filter: blur(20px);
    cursor: pointer;
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 1400px;
    max-height: 90vh;
    background: rgba(45, 27, 61, 0.95);
    border: 2px solid var(--spell-gold);
    border-radius: 16px;
    overflow: hidden;
    animation: modalSlideIn 0.4s ease-out;
    box-shadow:
            0 25px 80px rgba(0, 0, 0, 0.8),
            0 0 60px var(--glow-effect);
}

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

/* ─────────────────────────────────────────────────────────────── */
/* CLOSE BUTTON */
/* ─────────────────────────────────────────────────────────────── */
.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    background: rgba(61, 41, 82, 0.9);
    border: 2px solid var(--ethereal-lavender);
    border-radius: 50%;
    color: var(--frost-white);
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(220, 53, 69, 0.8);
    border-color: #dc3545;
    transform: rotate(90deg);
}

/* ─────────────────────────────────────────────────────────────── */
/* MODAL LAYOUT - TWO COLUMNS */
/* ─────────────────────────────────────────────────────────────── */
.modal-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    max-height: 90vh;
    gap: 0;
}

/* ─────────────────────────────────────────────────────────────── */
/* LEFT SIDE - IMAGE DISPLAY */
/* ─────────────────────────────────────────────────────────────── */
.modal-image-section {
    display: flex;
    flex-direction: column;
    background: rgba(18, 10, 28, 0.6);
    padding: 2rem;
    overflow: auto;
}

.modal-large-image {
    width: 100%;
    height: auto;
    max-height: calc(90vh - 180px);
    object-fit: contain;
    border-radius: 8px;
    border: 2px solid var(--ethereal-lavender);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.modal-image-info {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--ethereal-lavender);
}

.modal-image-info h2 {
    color: var(--frost-white);
    font-size: 1.8rem;
    font-weight: 300;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.modal-date {
    color: var(--magic-glow);
    font-size: 0.95rem;
    font-style: italic;
}

/* ─────────────────────────────────────────────────────────────── */
/* RIGHT SIDE - COMMENTS SECTION */
/* ─────────────────────────────────────────────────────────────── */
.modal-comments-section {
    display: flex;
    flex-direction: column;
    background: rgba(61, 41, 82, 0.6);
    border-left: 2px solid var(--ethereal-lavender);
    max-height: 90vh;
}

.comments-title {
    padding: 1.5rem;
    margin: 0;
    font-size: 1.4rem;
    font-weight: 300;
    color: var(--frost-white);
    border-bottom: 1px solid var(--ethereal-lavender);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.title-icon {
    font-size: 1.3rem;
}

/* ─────────────────────────────────────────────────────────────── */
/* COMMENTS LIST */
/* ─────────────────────────────────────────────────────────────── */
.comments-list {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    min-height: 200px;
}

.no-comments {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--ethereal-lavender);
}

.no-comments p {
    font-style: italic;
    font-size: 1rem;
}

.comment-item {
    background: rgba(45, 27, 61, 0.5);
    border: 1px solid var(--ethereal-lavender);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.comment-item:hover {
    border-color: var(--spell-gold);
    background: rgba(45, 27, 61, 0.7);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.comment-author {
    color: var(--spell-gold);
    font-weight: bold;
    font-size: 0.95rem;
}

.comment-time {
    color: var(--magic-glow);
    font-size: 0.85rem;
    font-style: italic;
}

.comment-body {
    color: var(--frost-white);
    line-height: 1.6;
    font-size: 0.95rem;
    word-wrap: break-word;
}

/* ─────────────────────────────────────────────────────────────── */
/* COMMENT FORM */
/* ─────────────────────────────────────────────────────────────── */
.comment-form {
    padding: 1.5rem;
    border-top: 1px solid var(--ethereal-lavender);
    background: rgba(45, 27, 61, 0.8);
}

.comment-form textarea {
    width: 100%;
    padding: 0.75rem;
    background: rgba(61, 41, 82, 0.6);
    border: 2px solid var(--ethereal-lavender);
    border-radius: 8px;
    color: var(--frost-white);
    font-family: 'Georgia', serif;
    font-size: 0.95rem;
    resize: vertical;
    min-height: 80px;
    transition: all 0.3s ease;
}

.comment-form textarea::placeholder {
    color: var(--magic-glow);
    opacity: 0.6;
}

.comment-form textarea:focus {
    outline: none;
    border-color: var(--spell-gold);
    background: rgba(61, 41, 82, 0.8);
    box-shadow: 0 0 15px rgba(232, 193, 112, 0.2);
}

.comment-form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.75rem;
}

.char-count {
    font-size: 0.85rem;
    color: var(--magic-glow);
}

.comment-submit {
    padding: 0.6rem 1.2rem;
    background: linear-gradient(135deg, var(--deep-violet), var(--mystic-blue));
    border: 2px solid var(--spell-gold);
    border-radius: 8px;
    color: var(--frost-white);
    font-family: 'Georgia', serif;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.comment-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(232, 193, 112, 0.4);
    background: linear-gradient(135deg, var(--mystic-blue), var(--spell-gold));
}

.comment-submit:active {
    transform: translateY(0);
}

.submit-icon {
    font-size: 1rem;
}

/* ─────────────────────────────────────────────────────────────── */
/* RESPONSIVE MODAL */
/* ─────────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .modal-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }

    .modal-image-section {
        padding: 1.5rem;
        max-height: 50vh;
    }

    .modal-large-image {
        max-height: 40vh;
    }

    .modal-comments-section {
        border-left: none;
        border-top: 2px solid var(--ethereal-lavender);
        max-height: 40vh;
    }

    .comments-list {
        min-height: 150px;
    }
}

@media (max-width: 768px) {
    .wallpaper-modal {
        padding: 0;
    }

    .modal-content {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
        height: 100vh;
    }

    .modal-layout {
        max-height: 100vh;
    }

    .modal-image-section {
        padding: 1rem;
        padding-top: 3rem; /* Space for close button */
    }

    .modal-close {
        top: 0.5rem;
        right: 0.5rem;
    }

    .comments-title {
        padding: 1rem;
        font-size: 1.2rem;
    }

    .comments-list {
        padding: 1rem;
    }

    .comment-form {
        padding: 1rem;
    }
}

/* ─────────────────────────────────────────────────────────────── */
/* SCROLLBAR STYLING FOR COMMENTS */
/* ─────────────────────────────────────────────────────────────── */
.comments-list::-webkit-scrollbar {
    width: 8px;
}

.comments-list::-webkit-scrollbar-track {
    background: rgba(45, 27, 61, 0.5);
}

.comments-list::-webkit-scrollbar-thumb {
    background: var(--ethereal-lavender);
    border-radius: 4px;
}

.comments-list::-webkit-scrollbar-thumb:hover {
    background: var(--spell-gold);
}