/* ==========================================
   FreeAiPrompts Global Style System
   ========================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text-main);
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 40px 0 0 0; /* padding bottom handled by footer */
    gap: 40px;
}

.container {
    width: 95%;
    max-width: 1200px;
    height: 85vh;
    max-height: 750px;
    min-height: 550px;
    background: var(--card-bg);
    border-radius: 30px;
    padding: 30px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.04);
    position: relative;
    flex-shrink: 0;
    border: 1px solid var(--border);
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 25px;
    width: 100%;
    flex-wrap: wrap;
    gap: 15px;
}

.logo-wrapper {
    font-size: inherit;
    font-weight: inherit;
    margin: 0;
    line-height: normal;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 32px;
    font-weight: 800;
    color: var(--text-main);
    text-decoration: none;
    transition: transform 0.2s;
}

.logo:hover {
    transform: scale(1.02);
}

.logo span {
    color: var(--primary);
}

.star {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    box-shadow: 0 10px 30px var(--primary-glow);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--nav-menu-bg);
    backdrop-filter: blur(10px);
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid var(--nav-menu-border);
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.03);
}

.nav-link {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link:hover {
    color: var(--primary);
    background: rgba(124, 58, 237, 0.05);
}

.nav-link.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    box-shadow: 0 4px 12px var(--primary-glow);
}

.main {
    display: flex;
    gap: 30px;
    height: calc(100% - 100px);
}

.image-section {
    flex: 1.3;
    position: relative;
    border-radius: 30px;
    overflow: hidden;
    background: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-section img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 30px;
    transition: opacity 0.5s ease;
}

/* For cute and nature detail page overrides */
.image-section-cover img {
    object-fit: cover;
}

.slider-overlay {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(8px);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    z-index: 5;
}

.prompt-section {
    width: 420px;
    background: white;
    border-radius: 30px;
    padding: 40px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    border: 1px solid rgba(226, 232, 240, 0.5);
}

/* Simple details page layout override */
.prompt-section-simple {
    flex: 0.8;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 10px 0;
}

.prompt-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 20px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.prompt-title-simple {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.prompt-title-simple::after {
    content: '';
    flex: 1;
    height: 2px;
    background: var(--prompt-box-border);
    border-radius: 2px;
}

.prompt-box {
    background: var(--prompt-box-bg);
    border: 2px solid var(--prompt-box-border);
    border-radius: 24px;
    padding: 24px;
    font-family: 'Consolas', 'Courier New', Courier, monospace;
    font-size: 14px;
    line-height: 1.6;
    color: #334155;
    margin-bottom: 25px;
    height: 200px;
    overflow-y: auto;
    word-break: break-word;
}

.prompt-box-simple {
    flex: 1;
    border-radius: 20px;
    padding: 20px;
    line-height: 1.7;
    margin-bottom: 25px;
    border: 1px solid var(--prompt-box-border);
}

.btns {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.btns-simple {
    flex-direction: row;
    gap: 15px;
}

button {
    border: none;
    height: 52px;
    border-radius: 16px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btns-simple button {
    flex: 1;
}

.copy-btn {
    background: var(--copy-btn-bg);
    color: white;
    box-shadow: 0 10px 25px var(--primary-glow);
}

.copy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px var(--primary-glow);
    background: var(--primary-hover);
}

.next-btn {
    background: var(--next-btn-bg);
    color: var(--next-btn-color);
}

.next-btn:hover {
    background: var(--next-btn-hover-bg);
    transform: translateY(-2px);
}

.nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    z-index: 10;
    user-select: none;
    transition: 0.2s;
    color: var(--primary);
}

.nav:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-50%) scale(1.05);
}

.prev {
    left: 20px;
}

.next {
    right: 20px;
}

.dots {
    position: absolute;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 5;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transition: 0.3s;
    cursor: pointer;
}

.dot.active {
    width: 35px;
    border-radius: 20px;
    background: white;
}

/* Category & Masonry System */
.filter-section {
    width: 95%;
    max-width: 1200px;
    margin: 0 auto -10px auto;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-tab {
    background: white;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 700;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: capitalize;
}

.filter-tab:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(124, 58, 237, 0.02);
}

.filter-tab.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 15px var(--primary-glow);
}

.masonry-section {
    width: 95%;
    max-width: 1200px;
    margin: 0 auto;
    flex-shrink: 0;
}

.masonry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.masonry-title {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 10px;
}

.masonry-grid {
    column-count: 4;
    column-gap: 20px;
    width: 100%;
    min-height: 400px;
}

.masonry-item {
    background: white;
    border-radius: 24px;
    padding: 18px;
    margin-bottom: 20px;
    break-inside: avoid;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.015);
    border: 1px solid var(--masonry-item-border);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: relative;
}

.masonry-item:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 35px var(--primary-glow);
    border-color: var(--masonry-item-hover-border);
}

.masonry-img-wrapper {
    width: 100%;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    background: #f8fafc;
}

.masonry-img {
    width: 100%;
    display: block;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.masonry-item:hover .masonry-img {
    transform: scale(1.05);
}

.masonry-desc {
    font-family: 'Consolas', 'Courier New', Courier, monospace;
    font-size: 12.5px;
    line-height: 1.55;
    color: var(--text-main);
    background: var(--prompt-box-bg);
    padding: 12px;
    border-radius: 12px;
    word-break: break-word;
    border-left: 3px solid var(--masonry-desc-border);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
}

.masonry-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

.masonry-tag {
    background: var(--masonry-tag-bg);
    color: var(--masonry-tag-color);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.masonry-stats {
    display: flex;
    align-items: center;
    gap: 10px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Loading Shimmers */
.skeleton {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.skeleton-img {
    height: 250px;
    border-radius: 16px;
}

.skeleton-text {
    height: 60px;
    border-radius: 12px;
}

.skeleton-meta {
    height: 15px;
    width: 60px;
    border-radius: 6px;
}

/* Pagination */
.pagination-container {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 30px;
}

.pagination-btn {
    background: white;
    border: 1px solid var(--border);
    color: var(--text-main);
    width: 44px;
    height: 44px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    transition: 0.2s;
}

.pagination-btn:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(124, 58, 237, 0.02);
    transform: translateY(-2px);
}

.pagination-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 12px var(--primary-glow);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(12px);
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 20px;
}

.modal.open {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: white;
    width: 95%;
    max-width: 1000px;
    border-radius: 28px;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    display: flex;
    transform: scale(0.92);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-height: 90vh;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.modal.open .modal-content {
    transform: scale(1);
}

.modal-left {
    flex: 1.2;
    background: #f1f5f9;
    position: relative;
    min-height: 400px;
}

.modal-left img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.modal-right {
    flex: 0.8;
    padding: 35px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow-y: auto;
}

.modal-header-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.modal-badge {
    background: #faf5ff;
    color: var(--primary);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid #ede9fe;
}

.modal-close-btn {
    background: #f1f5f9;
    color: var(--text-muted);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: 0.2s;
}

.modal-close-btn:hover {
    background: #e2e8f0;
    color: var(--text-main);
}

.modal-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 20px;
    line-height: 1.3;
}

.modal-field {
    margin-bottom: 20px;
}

.modal-field-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 1px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.lang-select {
    padding: 8px 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-main);
    outline: none;
    cursor: pointer;
    transition: 0.2s;
    background: white;
}

.lang-select:hover {
    border-color: var(--primary);
}

.modal-prompt-box {
    background: #faf8ff;
    border: 2px solid #ede9fe;
    border-radius: 20px;
    padding: 20px;
    font-family: 'Consolas', 'Courier New', Courier, monospace;
    font-size: 13.5px;
    line-height: 1.6;
    color: #334155;
    max-height: 250px;
    overflow-y: auto;
    word-break: break-word;
}

.modal-meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 25px;
    background: #f8fafc;
    padding: 15px;
    border-radius: 16px;
    border: 1px solid var(--border);
}

.meta-param {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.meta-param span:first-child {
    font-size: 10px;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.meta-param span:last-child {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    text-transform: capitalize;
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    color: white;
    padding: 16px 24px;
    border-radius: 16px;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    z-index: 110;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-check {
    width: 22px;
    height: 22px;
    background: #22c55e;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

/* Scroll loader spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(124, 58, 237, 0.1);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.card-copy-btn {
    background: rgba(124, 58, 237, 0.05);
    border: 1px solid rgba(124, 58, 237, 0.15);
    color: var(--primary);
    padding: 0 10px;
    height: 28px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.card-copy-btn:hover {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 10px var(--primary-glow);
    transform: scale(1.03);
}

/* Modern Footer Styles */
.footer {
    width: 100%;
    background: var(--card-bg);
    border-top: 1px solid var(--border);
    padding: 60px 20px 30px 20px;
    margin-top: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
    flex-shrink: 0;
}

.footer-content {
    width: 95%;
    max-width: 1200px;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.footer-desc {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
    max-width: 450px;
}

.footer-section-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 14px;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--primary);
}

.footer-contact {
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
}

.footer-contact strong {
    color: var(--text-main);
}

.footer-social {
    display: flex;
    gap: 12px;
    margin-top: 10px;
}

.social-icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 16px;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid var(--border);
}

.social-icon-btn:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 4px 10px var(--primary-glow);
}

.footer-bottom {
    width: 95%;
    max-width: 1200px;
    border-top: 1px solid var(--border);
    padding-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-muted);
    flex-wrap: wrap;
    gap: 15px;
}

/* Responsive Overrides */
@media(max-width: 1200px) {
    body {
        overflow: auto;
        padding: 20px 0 0 0;
        gap: 20px;
    }

    .container {
        height: auto;
        max-height: none;
        min-height: 0;
        border-radius: 20px;
        padding: 20px;
    }

    .main {
        flex-direction: column;
        height: auto;
        gap: 20px;
    }

    .image-section {
        height: 300px;
        flex: none;
    }

    .prompt-section {
        width: 100%;
        padding: 30px;
    }

    .prompt-box {
        margin-bottom: 20px;
        height: 120px;
    }

    .masonry-grid {
        column-count: 3;
    }
}

@media(max-width: 850px) {
    .modal-content {
        flex-direction: column;
        height: auto;
        max-height: 95vh;
    }

    .modal-left {
        min-height: 250px;
        flex: none;
    }

    .modal-right {
        flex: none;
        padding: 25px;
    }

    .modal-meta-grid {
        margin-bottom: 15px;
    }

    .modal-prompt-box {
        max-height: 150px;
    }
}

@media(max-width: 768px) {
    .logo {
        font-size: 24px;
    }

    .star {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    .nav-menu {
        width: 100%;
        justify-content: center;
    }

    .topbar {
        justify-content: center;
    }

    .masonry-grid {
        column-count: 2;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
        text-align: center;
    }

    .footer-desc {
        max-width: 100%;
    }

    .footer-social {
        justify-content: center;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
}

@media(max-width: 480px) {
    .masonry-grid {
        column-count: 1;
    }
}
