/*
Theme Name: Шифро
Theme URI: https://shifro.fun
Author: Шифро
Description: Лендинг и конструктор поздравительных квестов
Version: 2.0.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: surprise-hunt
*/

/* ===== CSS Variables — Light Festive Theme ===== */
:root {
    --red-festive: #ff4757;
    --yellow-gold: #ffa502;
    --blue-magic: #3742fa;
    --green-ok: #2ed573;
    --bg-cream: #fffdf7;
    --bg-white: #ffffff;
    --text-dark: #2f3542;
    --text-muted: #57606f;
    --text-dim: #a4b0be;
    --border-light: #f1f2f6;
    --shadow-card: 0 10px 30px rgba(0,0,0,0.06);
    --shadow-hover: 0 15px 40px rgba(0,0,0,0.1);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 32px;
    --font-main: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-hand: 'Caveat', cursive;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Reset & Base ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    overflow-x: hidden;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-cream);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--blue-magic);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--red-festive);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

h1, h2, h3, h4, h5, h6 {
    line-height: 1.2;
    font-weight: 800;
    color: var(--text-dark);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ===== Header ===== */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 12px 0;
    background: rgba(255, 253, 247, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 2px solid var(--border-light);
    transition: background var(--transition);
}

/* WP Admin Toolbar offset — только для администраторов */
body.admin-bar .site-header {
    top: 32px;
}
@media screen and (max-width: 782px) {
    body.admin-bar .site-header {
        top: 46px;
    }
}


body.admin-bar .constructor-page {
    padding-top: 112px;
}

body.admin-bar .payment-page {
    padding-top: 152px;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-logo {
    font-size: 1.6rem;
    font-weight: 900;
    font-family: var(--font-hand);
    color: var(--red-festive);
    letter-spacing: -0.5px;
}

.main-nav ul {
    display: flex;
    gap: 28px;
    list-style: none;
}

.main-nav a {
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.95rem;
    transition: color var(--transition);
    position: relative;
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 3px;
    background: var(--red-festive);
    border-radius: 2px;
    transition: width var(--transition);
}

.main-nav a:hover {
    color: var(--text-dark);
}

.main-nav a:hover::after {
    width: 100%;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 32px;
    border: none;
    border-radius: var(--radius-lg);
    font-family: var(--font-main);
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--red-festive);
    color: #fff;
    box-shadow: 0 8px 25px rgba(255, 71, 87, 0.35);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(255, 71, 87, 0.45);
    color: #fff;
}

.btn-secondary {
    background: transparent;
    color: var(--text-dark);
    border: 2px dashed var(--text-dim);
}

.btn-secondary:hover {
    border-color: var(--red-festive);
    color: var(--red-festive);
}

.btn-large {
    padding: 18px 48px;
    font-size: 1.15rem;
    border-radius: var(--radius-xl);
}

.btn-success {
    background: var(--green-ok);
    color: #fff;
    box-shadow: 0 5px 15px rgba(46, 213, 115, 0.3);
}

.btn-success:hover {
    filter: brightness(1.1);
    color: #fff;
    transform: translateY(-2px);
}

.btn-danger {
    background: var(--red-festive);
    color: #fff;
}

.btn-danger:hover {
    filter: brightness(0.9);
    color: #fff;
    transform: translateY(-2px);
}

.btn-magic {
    background: var(--red-festive);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 1.2rem;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(255, 71, 87, 0.3);
    transition: all 0.25s;
    font-family: var(--font-main);
}

.btn-magic:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 35px rgba(255, 71, 87, 0.45);
}

/* ===== Hero Section ===== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 120px 24px 80px;
    position: relative;
    background: var(--bg-cream);
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
}

.hero-badge {
    display: inline-block;
    padding: 8px 20px;
    border-radius: 100px;
    background: rgba(255, 71, 87, 0.1);
    border: 1px solid rgba(255, 71, 87, 0.2);
    color: var(--red-festive);
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 24px;
    animation: fadeInUp 0.6s ease-out;
}

.hero h1 {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 900;
    margin-bottom: 24px;
    letter-spacing: -1px;
    color: var(--text-dark);
    animation: fadeInUp 0.6s ease-out 0.1s both;
}

.hero h1 .gradient-text,
.handwritten {
    font-family: var(--font-hand);
    color: var(--red-festive);
    font-size: 1.1em;
}

.hero-subtitle {
    font-size: clamp(1.1rem, 2.5vw, 1.35rem);
    color: var(--text-muted);
    margin-bottom: 40px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    font-weight: 600;
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

.hero-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    animation: fadeInUp 0.6s ease-out 0.3s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Section Base ===== */
.section {
    padding: 90px 0;
    position: relative;
}

.section-title {
    text-align: center;
    font-size: clamp(2rem, 4vw, 2.8rem);
    font-weight: 900;
    margin-bottom: 16px;
    color: var(--text-dark);
}

.section-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 1.15rem;
    font-weight: 600;
    max-width: 600px;
    margin: 0 auto 64px;
}

/* ===== Cards ===== */
.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 32px;
}

.step-card {
    background: var(--bg-white);
    border: 2px dashed var(--border-light);
    border-radius: var(--radius-lg);
    padding: 40px 32px;
    text-align: center;
    transition: all var(--transition);
    position: relative;
}

.step-card:hover {
    transform: translateY(-8px) rotate(1deg);
    border-color: var(--yellow-gold);
    box-shadow: var(--shadow-hover);
}

.step-number {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--red-festive);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 900;
    margin: 0 auto 20px;
    color: #fff;
    box-shadow: 0 5px 15px rgba(255, 71, 87, 0.3);
    transform: rotate(-10deg);
}

.step-icon {
    font-size: 2.5rem;
    margin-bottom: 16px;
}

.step-card h3 {
    font-size: 1.3rem;
    margin-bottom: 12px;
    color: var(--text-dark);
}

.step-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 600;
}

/* ===== Example Cards ===== */
.examples-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.example-card {
    border: 2px dashed var(--border-light);
    border-radius: var(--radius-lg);
    padding: 32px;
    background: var(--bg-white);
    transition: all var(--transition);
}

.example-card:hover {
    border-color: var(--yellow-gold);
    transform: translateY(-4px);
    box-shadow: var(--shadow-card);
}

.example-card .tag {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.tag-detective {
    background: rgba(55, 66, 250, 0.1);
    color: var(--blue-magic);
}

.tag-fantasy {
    background: rgba(255, 165, 2, 0.1);
    color: var(--yellow-gold);
}

.tag-romantic {
    background: rgba(255, 71, 87, 0.1);
    color: var(--red-festive);
}

.example-card h3 {
    margin-bottom: 8px;
    font-size: 1.2rem;
}

.example-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
}

/* ===== FAQ ===== */
.faq-list {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.faq-item {
    border: 2px solid var(--border-light);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-white);
    transition: border-color var(--transition);
}

.faq-item:hover {
    border-color: var(--yellow-gold);
}

.faq-question {
    padding: 20px 24px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    font-size: 1.05rem;
    user-select: none;
    color: var(--text-dark);
}

.faq-question::after {
    content: '+';
    font-size: 1.5rem;
    color: var(--red-festive);
    transition: transform var(--transition);
    font-weight: 800;
}

.faq-item.active .faq-question::after {
    transform: rotate(45deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.faq-item.active .faq-answer {
    max-height: 300px;
}

.faq-answer-inner {
    padding: 0 24px 20px;
    color: var(--text-muted);
    line-height: 1.7;
    font-weight: 600;
}

/* ===== CTA Section ===== */
.cta-section {
    text-align: center;
    padding: 100px 0 120px;
}

.cta-box {
    background: var(--blue-magic);
    border-radius: var(--radius-xl);
    padding: 64px 48px;
    max-width: 700px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
    color: #fff;
}

.cta-box h2 {
    font-size: 2rem;
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
    color: #fff;
}

.cta-box p {
    color: rgba(255,255,255,0.85);
    margin-bottom: 32px;
    font-size: 1.1rem;
    font-weight: 600;
    position: relative;
    z-index: 1;
}

/* ===== Footer ===== */
.site-footer {
    padding: 50px 0 30px;
    background: var(--text-dark);
    text-align: center;
    color: rgba(255,255,255,0.5);
    font-size: 0.9rem;
    font-weight: 600;
}

.site-footer a {
    color: rgba(255,255,255,0.7);
}

.site-footer a:hover {
    color: #fff;
}

/* ===== Constructor Page ===== */
.constructor-page {
    padding-top: 80px;
    min-height: 100vh;
    background: var(--bg-cream);
}

.constructor-page #app,
.constructor-page #quest-app {
    min-height: calc(100vh - 80px);
}

/* ===== Payment Page ===== */
.payment-page {
    padding-top: 120px;
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    background: var(--bg-cream);
}

.payment-card {
    background: var(--bg-white);
    border: 2px dashed var(--border-light);
    border-radius: var(--radius-xl);
    padding: 48px;
    max-width: 500px;
    width: 100%;
    text-align: center;
    box-shadow: var(--shadow-card);
}

.payment-card h1 {
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.payment-card .quest-id {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 32px;
}

.payment-amount {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--red-festive);
    margin-bottom: 32px;
}

.payment-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.payment-result {
    margin-top: 24px;
    padding: 16px;
    border-radius: var(--radius-md);
    font-weight: 700;
}

.payment-result.success {
    background: rgba(46, 213, 115, 0.1);
    color: var(--green-ok);
    border: 2px solid rgba(46, 213, 115, 0.3);
}

.payment-result.fail {
    background: rgba(255, 71, 87, 0.1);
    color: var(--red-festive);
    border: 2px solid rgba(255, 71, 87, 0.3);
}

/* ===== Dashboard Styles ===== */
.main-content {
    padding-top: 100px;
    min-height: 70vh;
}

.page-title {
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--text-dark);
}

/* ===== Text Page Template ===== */
.text-page {
    padding-top: 100px;
    min-height: 70vh;
}

.text-page-content {
    max-width: 800px;
    margin: 0 auto;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 48px;
    box-shadow: var(--shadow-card);
    border: 2px solid var(--border-light);
}

.text-page-content h1 {
    font-size: 2rem;
    margin-bottom: 24px;
}

.text-page-content h2 {
    font-size: 1.5rem;
    margin-top: 32px;
    margin-bottom: 16px;
}

.text-page-content h3 {
    font-size: 1.2rem;
    margin-top: 24px;
    margin-bottom: 12px;
}

.text-page-content p {
    color: var(--text-muted);
    margin-bottom: 16px;
    font-weight: 600;
    line-height: 1.8;
}

.text-page-content ul,
.text-page-content ol {
    color: var(--text-muted);
    margin-bottom: 16px;
    padding-left: 24px;
    font-weight: 600;
}

.text-page-content li {
    margin-bottom: 8px;
}

.text-page-content a {
    color: var(--blue-magic);
    text-decoration: underline;
}

.text-page-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 24px;
}

.text-page-content th,
.text-page-content td {
    border: 1px solid var(--border-light);
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
}

.text-page-content th {
    background: var(--bg-cream);
    font-weight: 800;
}

/* ===== Spinner ===== */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-light);
    border-top-color: var(--red-festive);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .main-nav ul {
        gap: 16px;
    }

    .hero {
        padding: 100px 16px 60px;
    }

    .hero-actions {
        flex-direction: column;
        align-items: center;
    }

    .section {
        padding: 60px 0;
    }

    .steps-grid {
        grid-template-columns: 1fr;
    }

    .cta-box {
        padding: 40px 24px;
    }

    .payment-card {
        margin: 0 16px;
        padding: 32px 24px;
    }

    .text-page-content {
        padding: 24px;
        border-radius: var(--radius-md);
    }
}