@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;500;600;700&family=Lato:wght@300;400;700&family=Dancing+Script:wght@500;700&display=swap');

:root {
    --primary: #e8a0b4;
    --primary-light: #fdf2f4;
    --primary-dark: #d4789a;
    --secondary: #fefafb;
    --accent: #c9a0dc;
    --accent-light: #f3e8f7;
    --gold: #d4a574;
    --text: #4a3c3f;
    --text-light: #7a6a6d;
    --white: #ffffff;
    --success: #7bc47f;
    --success-light: #e8f5e9;
    --danger: #e57373;
    --danger-light: #ffebee;
    --shadow-soft: 0 8px 32px rgba(232, 160, 180, 0.15);
    --shadow-medium: 0 12px 40px rgba(232, 160, 180, 0.25);
    --border-radius: 16px;
    --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Lato', sans-serif;
    background: linear-gradient(135deg, #fdf2f8 0%, #fefcfd 50%, #f8f4ff 100%);
    background-attachment: fixed;
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
}

/* ============ Login Page ============ */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.login-container::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -30%;
    width: 80%;
    height: 80%;
    background: radial-gradient(circle, rgba(232, 160, 180, 0.1) 0%, transparent 60%);
    animation: float 15s ease-in-out infinite;
}

.login-container::after {
    content: '';
    position: absolute;
    bottom: -40%;
    left: -30%;
    width: 70%;
    height: 70%;
    background: radial-gradient(circle, rgba(201, 160, 220, 0.1) 0%, transparent 60%);
    animation: float 18s ease-in-out infinite reverse;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
    }

    50% {
        transform: translate(30px, -30px) rotate(5deg);
    }
}

.login-box {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    padding: 3.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-medium);
    width: 100%;
    max-width: 420px;
    text-align: center;
    position: relative;
    z-index: 1;
    border: 1px solid rgba(232, 160, 180, 0.15);
    animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-box h1 {
    font-family: 'Dancing Script', cursive;
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
    font-size: 2.8rem;
}

.login-box .subtitle {
    color: var(--text-light);
    margin-bottom: 2.5rem;
    font-size: 0.95rem;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 0.6rem;
    font-weight: 600;
    color: var(--text);
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 2px solid rgba(232, 160, 180, 0.2);
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.8);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(232, 160, 180, 0.15);
}

.form-group textarea {
    min-height: 350px;
    resize: vertical;
    line-height: 1.9;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    border: none;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: 0.6s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    box-shadow: 0 6px 20px rgba(232, 160, 180, 0.4);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(232, 160, 180, 0.5);
}

.btn-secondary {
    background: var(--white);
    color: var(--text);
    border: 2px solid rgba(232, 160, 180, 0.3);
}

.btn-secondary:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger) 0%, #ef5350 100%);
    color: var(--white);
    box-shadow: 0 4px 15px rgba(229, 115, 115, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(229, 115, 115, 0.4);
}

.btn-small {
    padding: 0.6rem 1.25rem;
    font-size: 0.85rem;
}

.error-message {
    background: linear-gradient(135deg, var(--danger-light) 0%, #fff5f5 100%);
    color: var(--danger);
    padding: 1rem 1.25rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    display: none;
    border: 1px solid rgba(229, 115, 115, 0.2);
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

.success-message {
    background: linear-gradient(135deg, var(--success-light) 0%, #f1f8f1 100%);
    color: var(--success);
    padding: 1rem 1.25rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    display: none;
    border: 1px solid rgba(123, 196, 127, 0.2);
    animation: fadeInUp 0.5s ease-out;
}

.support-message {
    margin-bottom: 1.5rem;
    padding: 1rem 1.25rem;
    border-radius: 12px;
    color: var(--text);
    background: linear-gradient(135deg, #fff9ec 0%, #fff3f6 100%);
    border: 1px solid rgba(212, 165, 116, 0.3);
    box-shadow: 0 6px 20px rgba(212, 165, 116, 0.12);
    animation: fadeInUp 0.55s ease-out;
}

.support-title {
    margin-bottom: 0.4rem;
    font-weight: 700;
    color: #9f6b3f;
}

.support-dialog-overlay {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: rgba(74, 60, 63, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    z-index: 1000;
    animation: fadeInUp 0.25s ease-out;
}

.support-dialog-card {
    width: 100%;
    max-width: 560px;
    background: linear-gradient(140deg, #fffaf0 0%, #fff7fb 50%, #ffffff 100%);
    border: 1px solid rgba(212, 165, 116, 0.35);
    border-radius: 18px;
    box-shadow: 0 20px 55px rgba(74, 60, 63, 0.28);
    padding: 1.5rem 1.5rem 1.25rem;
}

.support-dialog-kicker {
    font-size: 0.8rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #9f6b3f;
    margin-bottom: 0.45rem;
    font-weight: 700;
}

.support-dialog-card h3 {
    font-family: 'Playfair Display', serif;
    color: var(--text);
    font-size: 1.65rem;
    margin-bottom: 0.7rem;
}

.support-dialog-text {
    color: var(--text);
    line-height: 1.75;
    margin-bottom: 1.1rem;
}

.support-dialog-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

/* ============ Admin Header ============ */
.admin-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 50%, var(--accent) 100%);
    padding: 1.25rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(232, 160, 180, 0.3);
}

.admin-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
}

.admin-header h1 {
    font-family: 'Dancing Script', cursive;
    color: var(--white);
    font-size: 1.8rem;
    text-shadow: 1px 2px 4px rgba(0, 0, 0, 0.1);
}

.admin-header nav {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.admin-menu-toggle {
    display: none;
    border: 1px solid rgba(255, 255, 255, 0.65);
    background: rgba(255, 255, 255, 0.15);
    color: var(--white);
    border-radius: 999px;
    padding: 0.5rem 0.95rem;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
}

.admin-menu-toggle:hover {
    background: rgba(255, 255, 255, 0.28);
}

.admin-header a {
    color: var(--white);
    text-decoration: none;
    padding: 0.6rem 1.25rem;
    border-radius: 25px;
    opacity: 0.9;
    transition: var(--transition);
    font-weight: 500;
    font-size: 0.9rem;
}

.admin-header a:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.2);
}

/* ============ Admin Main ============ */
.admin-main {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2.5rem;
    animation: fadeInUp 0.6s ease-out;
}

.admin-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.admin-title h2 {
    font-family: 'Playfair Display', serif;
    color: var(--text);
    font-size: 1.8rem;
    position: relative;
}

.admin-title h2::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 50px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 2px;
}

/* ============ Posts Table ============ */
.posts-table {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
    border: 1px solid rgba(232, 160, 180, 0.1);
}

.posts-table table {
    width: 100%;
    border-collapse: collapse;
}

.posts-table th,
.posts-table td {
    padding: 1.25rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid rgba(232, 160, 180, 0.1);
}

.posts-table th {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--accent-light) 100%);
    font-weight: 600;
    color: var(--text);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.posts-table tr:last-child td {
    border-bottom: none;
}

.posts-table tbody tr {
    transition: var(--transition);
}

.posts-table tbody tr:hover {
    background: rgba(232, 160, 180, 0.05);
}

.posts-table .actions {
    display: flex;
    gap: 0.5rem;
}

.empty-table {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-light);
}

.empty-table .icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    animation: float 3s ease-in-out infinite;
}

.empty-table a {
    color: var(--primary-dark);
    font-weight: 600;
}

/* ============ Editor Container ============ */
.editor-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-soft);
    padding: 2.5rem;
    border: 1px solid rgba(232, 160, 180, 0.1);
}

.editor-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(232, 160, 180, 0.1);
}

.image-editor-panel {
    margin-top: 1rem;
    border: 1px solid rgba(232, 160, 180, 0.2);
    border-radius: 14px;
    padding: 1rem;
    background: rgba(253, 242, 244, 0.45);
}

.image-editor-toolbar {
    display: flex;
    gap: 0.55rem;
    flex-wrap: wrap;
    margin-bottom: 0.6rem;
}

.image-editor-hint {
    color: var(--text-light);
    font-size: 0.86rem;
    margin-bottom: 0.85rem;
}

.image-editor-canvas-wrap {
    width: 100%;
    min-height: 260px;
    max-height: 62vh;
    background: repeating-linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.8),
        rgba(255, 255, 255, 0.8) 10px,
        rgba(248, 244, 255, 0.85) 10px,
        rgba(248, 244, 255, 0.85) 20px
    );
    border-radius: 12px;
    overflow: hidden;
}

.image-editor-canvas-wrap img {
    display: block;
    width: 100%;
    max-width: 100%;
}

.gallery-admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
    align-items: start;
}

.gallery-admin-card {
    border-radius: 14px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(232, 160, 180, 0.15);
    box-shadow: var(--shadow-soft);
    min-width: 0;
}

.gallery-admin-card img {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 5;
    display: block;
    object-fit: cover;
}

.gallery-admin-card-body {
    padding: 1rem;
}

.gallery-admin-card-body h3 {
    font-family: 'Playfair Display', serif;
    margin-bottom: 0.4rem;
    color: var(--text);
}

.gallery-admin-card-body p {
    color: var(--text-light);
    margin-bottom: 0.8rem;
    overflow-wrap: anywhere;
}

.pagination {
    margin-top: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--white);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 999px;
    padding: 0.55rem 1rem;
    font-weight: 600;
    box-shadow: 0 6px 18px rgba(232, 160, 180, 0.35);
    transition: var(--transition);
}

.pagination-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(232, 160, 180, 0.45);
}

.pagination-info {
    color: var(--text-light);
    font-weight: 600;
}

/* ============ Scrollbar ============ */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--primary-light);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary), var(--accent));
    border-radius: 5px;
}

/* ============ Selection ============ */
::selection {
    background: var(--primary);
    color: var(--white);
}

/* ============ Responsive ============ */
@media (max-width: 768px) {
    .admin-header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .admin-header h1 {
        font-size: 1.5rem;
        text-align: center;
    }

    .admin-menu-toggle {
        display: inline-flex;
        align-self: flex-end;
    }

    .admin-header nav {
        width: 100%;
        display: none;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.55rem;
    }

    .admin-header nav.is-open {
        display: grid;
    }

    .admin-header a {
        width: 100%;
        text-align: center;
        padding: 0.6rem 0.75rem;
    }

    .admin-title {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .admin-title h2::after {
        left: 50%;
        transform: translateX(-50%);
    }

    .admin-main {
        padding: 1.5rem;
    }

    .posts-table {
        overflow-x: auto;
    }

    .posts-table table {
        min-width: 550px;
    }

    .login-box {
        padding: 2rem;
    }

    .editor-container {
        padding: 1.5rem;
    }

    .editor-actions {
        flex-direction: column;
    }

    .editor-actions .btn {
        width: 100%;
    }

    .image-editor-canvas-wrap {
        min-height: 210px;
        max-height: 50vh;
    }

    .support-dialog-actions {
        flex-direction: column;
    }

    .support-dialog-actions .btn {
        width: 100%;
    }

    .gallery-admin-card img {
        aspect-ratio: 1 / 1;
    }

    .gallery-admin-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 420px) {
    .admin-header nav {
        grid-template-columns: 1fr;
    }

    .admin-menu-toggle {
        align-self: stretch;
        justify-content: center;
    }
}
