/* =========================================================
   CREATOR DASHBOARD
========================================================= */

:root {
    --creator-blue: #007bff;
    --creator-blue-dark: #0069d9;
    --creator-bg: #f5f7fa;
    --creator-card: #ffffff;
    --creator-text: #222222;
    --creator-muted: #6b7280;
    --creator-border: #e2e8f0;
    --creator-danger: #dc3545;
    --creator-success: #16a34a;
    --creator-shadow: 0 20px 60px rgba(0, 0, 0, 0.12);
}

* {
    box-sizing: border-box;
}

button,
input,
textarea,
select {
    font: inherit;
}

.creator-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: var(--creator-bg);
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.creator-overlay.visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.creator-dashboard {
    min-height: 100vh;
}


/* =========================================================
   HEADER
========================================================= */

.creator-header {
    position: sticky;
    top: 0;
    z-index: 50;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 18px 30px;

    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);

    border-bottom: 1px solid var(--creator-border);
}

.creator-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.creator-logo {
    width: 46px;
    height: 46px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 13px;

    background: rgba(0, 123, 255, 0.1);

    font-size: 23px;
}

.creator-label,
.creator-section-label {
    display: block;

    margin-bottom: 4px;

    color: var(--creator-blue);

    font-size: 10px;
    font-weight: 800;

    letter-spacing: 1.6px;
}

.creator-header h1 {
    margin: 0;

    font-size: 21px;
    color: var(--creator-text);
}

.creator-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.creator-header-button,
.creator-close-button {
    border: 1px solid var(--creator-border);

    background: white;
    color: var(--creator-text);

    cursor: pointer;

    transition: 0.2s ease;
}

.creator-header-button {
    padding: 10px 16px;
    border-radius: 9px;
    font-weight: 700;
}

.creator-header-button:hover {
    background: #f3f4f6;
}

.creator-close-button {
    width: 40px;
    height: 40px;

    border-radius: 9px;

    font-size: 16px;
}

.creator-close-button:hover {
    background: #f3f4f6;
}


/* =========================================================
   CONTENT
========================================================= */

.creator-content {
    width: min(1250px, calc(100% - 40px));

    margin: 0 auto;

    padding: 30px 0 80px;
}

.creator-stats-grid {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 16px;

    margin-bottom: 20px;
}

.creator-stat-card {
    display: flex;
    align-items: center;
    gap: 15px;

    padding: 20px;

    background: var(--creator-card);

    border: 1px solid var(--creator-border);
    border-radius: 15px;

    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.04);
}

.creator-stat-icon {
    width: 45px;
    height: 45px;

    display: flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    border-radius: 12px;

    background: rgba(0, 123, 255, 0.1);

    font-size: 20px;
}

.creator-stat-card span {
    display: block;

    color: var(--creator-muted);

    font-size: 12px;
}

.creator-stat-card strong {
    display: block;

    margin-top: 3px;

    color: var(--creator-text);

    font-size: 25px;
}

.creator-stat-card small {
    display: block;

    margin-top: 3px;

    color: #9ca3af;

    font-size: 9px;
}


/* =========================================================
   PANELS
========================================================= */

.creator-panel {
    margin-top: 20px;

    padding: 25px;

    background: var(--creator-card);

    border: 1px solid var(--creator-border);
    border-radius: 17px;

    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.035);
}

.creator-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 20px;

    margin-bottom: 20px;
}

.creator-panel-header h2 {
    margin: 0;

    color: var(--creator-text);

    font-size: 21px;
}

.creator-panel-header p {
    margin: 7px 0 0;

    color: var(--creator-muted);

    font-size: 13px;
}

.creator-muted {
    color: var(--creator-muted);

    font-size: 11px;
}


/* =========================================================
   BUTTONS
========================================================= */

.primary-button,
.secondary-button {
    min-height: 42px;

    padding: 0 17px;

    border-radius: 9px;

    cursor: pointer;

    font-weight: 700;
    font-size: 13px;

    transition:
        background 0.2s ease,
        transform 0.2s ease,
        opacity 0.2s ease;
}

.primary-button {
    border: none;

    background: var(--creator-blue);
    color: white;
}

.primary-button:hover {
    background: var(--creator-blue-dark);
    transform: translateY(-1px);
}

.primary-button:disabled {
    opacity: 0.6;
    cursor: wait;
}

.secondary-button {
    border: 1px solid var(--creator-border);

    background: white;
    color: var(--creator-text);
}

.secondary-button:hover {
    background: #f5f6f8;
}


/* =========================================================
   STATUS
========================================================= */

.status-grid {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 12px;
}

.status-card {
    display: flex;
    align-items: center;
    gap: 12px;

    padding: 15px;

    border: 1px solid var(--creator-border);
    border-radius: 11px;

    background: #fafbfc;
}

.status-dot {
    width: 10px;
    height: 10px;

    flex-shrink: 0;

    border-radius: 50%;

    background: #9ca3af;
}

.status-card span {
    display: block;

    color: var(--creator-muted);

    font-size: 11px;
}

.status-card strong {
    display: block;

    margin-top: 2px;

    font-size: 13px;
}

.status-good {
    color: var(--creator-success);
}

.status-bad {
    color: var(--creator-danger);
}

.status-checking {
    color: #f59e0b;
}


/* =========================================================
   VISITOR MAP
========================================================= */

.visitor-map {
    width: 100%;
    height: 380px;

    overflow: hidden;

    border: 1px solid var(--creator-border);
    border-radius: 12px;

    background: #eef2f7;
}

.leaflet-container {
    font-family: inherit;
}


/* =========================================================
   PROJECTS
========================================================= */

.creator-projects {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.creator-project-card {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    padding: 18px;

    border: 1px solid var(--creator-border);
    border-radius: 13px;

    background: #fafbfc;
}

.creator-project-info {
    min-width: 0;
}

.creator-project-title {
    display: flex;
    align-items: center;

    gap: 9px;
}

.creator-project-title h3 {
    margin: 0;

    color: var(--creator-text);

    font-size: 16px;
}

.creator-project-info p {
    margin: 8px 0;

    color: var(--creator-muted);

    font-size: 13px;
    line-height: 1.55;
}

.creator-project-info small {
    color: #777;

    font-size: 11px;
}

.active-badge,
.timeline-hidden-badge,
.timeline-position-badge {
    display: inline-flex;
    align-items: center;

    min-height: 20px;

    padding: 3px 7px;

    border-radius: 5px;

    font-size: 8px;
    font-weight: 800;

    letter-spacing: 0.8px;
}

.active-badge {
    background: #dcfce7;
    color: #15803d;
}

.timeline-hidden-badge {
    background: #eeeeee;
    color: #777;
}

.timeline-position-badge {
    background: #e0f2fe;
    color: #0369a1;
}

.creator-project-actions {
    display: flex;
    flex-wrap: wrap;

    justify-content: flex-end;

    gap: 7px;

    flex-shrink: 0;
}

.creator-project-actions button,
.creator-timeline-actions button {
    min-height: 34px;

    padding: 0 10px;

    border: 1px solid var(--creator-border);
    border-radius: 7px;

    background: white;
    color: var(--creator-text);

    cursor: pointer;

    font-size: 11px;
    font-weight: 700;

    transition: 0.2s ease;
}

.creator-project-actions button:hover,
.creator-timeline-actions button:hover {
    background: #f1f3f5;
}

.creator-project-actions button[data-delete],
.creator-timeline-actions button[data-timeline-delete] {
    color: var(--creator-danger);
}

.empty-projects {
    padding: 45px 20px;

    text-align: center;

    border: 1px dashed var(--creator-border);
    border-radius: 12px;
}

.empty-projects span {
    display: block;

    margin-bottom: 10px;

    font-size: 32px;
}

.empty-projects h3 {
    margin: 0;

    color: var(--creator-text);

    font-size: 16px;
}

.empty-projects p {
    margin: 6px 0 0;

    color: var(--creator-muted);

    font-size: 12px;
}


/* =========================================================
   TIMELINE
========================================================= */

.creator-timeline {
    display: flex;
    flex-direction: column;

    gap: 12px;
}

.creator-timeline-card {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    padding: 18px;

    border: 1px solid var(--creator-border);
    border-radius: 13px;

    background: #fafbfc;
}

.creator-timeline-info {
    min-width: 0;
}

.creator-timeline-top {
    display: flex;
    align-items: center;

    flex-wrap: wrap;

    gap: 7px;

    margin-bottom: 7px;
}

.creator-timeline-year {
    font-size: 11px;
    font-weight: 800;

    color: var(--creator-blue);
}

.creator-timeline-info h3 {
    margin: 0;

    color: var(--creator-text);

    font-size: 16px;
}

.creator-timeline-info p {
    margin: 7px 0;

    color: var(--creator-muted);

    font-size: 13px;
    line-height: 1.5;
}

.creator-timeline-meta {
    color: #999;

    font-size: 10px;
}

.creator-timeline-actions {
    display: flex;
    flex-wrap: wrap;

    justify-content: flex-end;

    gap: 6px;

    flex-shrink: 0;
}


/* =========================================================
   EDITOR OVERLAYS
========================================================= */

.creator-editor-overlay {
    position: fixed;
    inset: 0;

    z-index: 1000000;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 20px;

    background: rgba(0, 0, 0, 0.7);

    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transition:
        opacity 0.3s ease,
        visibility 0.3s ease;
}

.creator-editor-overlay.visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.creator-editor-card {
    width: min(600px, 96vw);
    max-height: 90vh;

    overflow-y: auto;

    padding: 28px;

    border-radius: 17px;

    background: white;

    box-shadow: 0 35px 100px rgba(0, 0, 0, 0.4);

    transform: translateY(20px) scale(0.97);

    transition: transform 0.3s ease;
}

.creator-editor-overlay.visible .creator-editor-card {
    transform: translateY(0) scale(1);
}

.creator-editor-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 15px;

    margin-bottom: 25px;
}

.creator-editor-header h2 {
    margin: 0;

    font-size: 23px;

    color: var(--creator-text);
}

.editor-close {
    width: 36px;
    height: 36px;

    border: 1px solid var(--creator-border);
    border-radius: 8px;

    background: white;

    cursor: pointer;

    color: var(--creator-text);
}

.form-row {
    display: grid;

    grid-template-columns:
        1fr 1fr;

    gap: 14px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;

    margin-bottom: 7px;

    color: var(--creator-text);

    font-size: 12px;
    font-weight: 700;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;

    border: 1px solid var(--creator-border);
    border-radius: 9px;

    padding: 11px 13px;

    background: #f9fafb;
    color: var(--creator-text);

    outline: none;

    font-size: 13px;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.form-group input,
.form-group select {
    height: 44px;
}

.form-group textarea {
    resize: vertical;

    min-height: 90px;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--creator-blue);

    box-shadow:
        0 0 0 3px rgba(0, 123, 255, 0.1);
}

.checkbox-row {
    display: flex;
    align-items: center;

    gap: 9px;

    margin: 8px 0 20px;

    color: var(--creator-text);

    font-size: 12px;
    font-weight: 600;

    cursor: pointer;
}

.checkbox-row input {
    width: 16px;
    height: 16px;
}

.editor-actions {
    display: flex;
    justify-content: flex-end;

    gap: 9px;

    padding-top: 10px;

    border-top: 1px solid var(--creator-border);
}


/* =========================================================
   PASSWORD SCREEN
========================================================= */

.creator-password-screen {
    position: fixed;
    inset: 0;

    z-index: 2147483647;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 20px;

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transition:
        opacity 0.35s ease,
        visibility 0.35s ease;
}

.creator-password-screen.creator-password-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.creator-password-screen.creator-password-closing {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.creator-password-backdrop {
    position: absolute;
    inset: 0;

    background: rgba(0, 0, 0, 0.82);

    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.creator-password-card {
    position: relative;

    z-index: 2;

    width: min(460px, 94vw);

    padding: 38px;

    border-radius: 22px;

    background: white;
    color: var(--creator-text);

    border: 1px solid var(--creator-border);

    box-shadow: 0 35px 100px rgba(0, 0, 0, 0.5);

    transform: translateY(30px) scale(0.96);

    opacity: 0;

    transition:
        transform 0.45s cubic-bezier(.2,.8,.2,1),
        opacity 0.35s ease;
}

.creator-password-screen.creator-password-visible
.creator-password-card {
    transform: translateY(0) scale(1);

    opacity: 1;
}

.creator-password-icon {
    width: 58px;
    height: 58px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 16px;

    background: rgba(0, 123, 255, 0.1);

    font-size: 28px;

    margin-bottom: 18px;
}

.creator-password-badge,
.easter-game-badge {
    display: inline-block;

    padding: 5px 9px;

    border-radius: 6px;

    background: var(--creator-blue);
    color: white;

    font-size: 9px;
    font-weight: 800;

    letter-spacing: 1.5px;

    margin-bottom: 12px;
}

.creator-password-card h1 {
    margin: 0 0 10px;

    font-size: 30px;
}

.creator-password-subtitle {
    margin: 0 0 28px;

    color: #666;

    line-height: 1.6;

    font-size: 14px;
}

.creator-password-field {
    margin-bottom: 14px;
}

.creator-password-field label {
    display: block;

    margin-bottom: 8px;

    font-size: 13px;
    font-weight: 700;
}

#creatorEmailInput,
#creatorPasswordInput {
    width: 100%;
    height: 50px;

    padding: 0 15px;

    border: 1px solid var(--creator-border);
    border-radius: 10px;

    background: #f8f9fa;
    color: var(--creator-text);

    outline: none;

    font-size: 15px;
}

#creatorPasswordInput {
    padding-right: 52px;
}

#creatorEmailInput:focus,
#creatorPasswordInput:focus {
    border-color: var(--creator-blue);

    box-shadow:
        0 0 0 3px rgba(0, 123, 255, 0.12);
}

.creator-password-input-wrapper {
    position: relative;

    width: 100%;
}

#creatorPasswordToggle {
    position: absolute;

    right: 7px;
    top: 7px;

    width: 36px;
    height: 36px;

    border: none;
    border-radius: 7px;

    background: transparent;

    cursor: pointer;

    font-size: 16px;
}

#creatorPasswordToggle:hover {
    background: rgba(127, 127, 127, 0.12);
}

.creator-password-error {
    min-height: 21px;

    color: var(--creator-danger);

    font-size: 12px;

    margin: 5px 0 10px;
}

.creator-password-actions {
    display: flex;

    gap: 10px;

    margin-top: 15px;
}

.creator-password-actions button {
    flex: 1;

    min-height: 45px;

    border-radius: 9px;

    cursor: pointer;

    font-weight: 700;

    font-size: 13px;
}

.creator-password-cancel {
    border: 1px solid var(--creator-border);

    background: transparent;

    color: var(--creator-text);
}

.creator-password-submit {
    border: none;

    background: var(--creator-blue);

    color: white;
}

.creator-password-submit:disabled {
    opacity: 0.6;

    cursor: wait;
}

.creator-password-footer {
    text-align: center;

    margin-top: 24px;
    padding-top: 18px;

    border-top: 1px solid var(--creator-border);

    color: #888;

    font-size: 10px;
}

.creator-password-shake {
    animation: creatorPasswordShake 0.45s ease;
}

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

    20% {
        transform: translateX(-8px);
    }

    40% {
        transform: translateX(8px);
    }

    60% {
        transform: translateX(-6px);
    }

    80% {
        transform: translateX(6px);
    }
}


/* =========================================================
   EASTER EGG GAME
========================================================= */

.easter-game {
    position: fixed;
    inset: 0;

    z-index: 2147483647;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 20px;

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transition:
        opacity 0.35s ease,
        visibility 0.35s ease;
}

.easter-game.easter-game-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.easter-game-backdrop {
    position: absolute;
    inset: 0;

    background: rgba(0, 0, 0, 0.88);

    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.easter-game-card {
    position: relative;

    z-index: 2;

    width: min(590px, 96vw);

    padding: 30px;

    border-radius: 20px;

    background: #171717;
    color: white;

    border: 1px solid #333;

    box-shadow:
        0 40px 120px rgba(0, 0, 0, 0.65);

    transform: scale(0.92) translateY(25px);

    opacity: 0;

    transition:
        transform 0.45s ease,
        opacity 0.35s ease;
}

.easter-game.easter-game-visible
.easter-game-card {
    transform: scale(1) translateY(0);

    opacity: 1;
}

.easter-game-close {
    position: absolute;

    top: 15px;
    right: 15px;

    width: 34px;
    height: 34px;

    border: 1px solid #444;
    border-radius: 8px;

    background: #222;
    color: white;

    cursor: pointer;
}

.easter-game-card h1 {
    margin: 0 0 8px;

    color: white;
}

.easter-game-card p {
    color: #aaa;
}

.easter-game-stats {
    display: flex;
    justify-content: space-between;

    margin-bottom: 12px;

    color: #aaa;
}

.easter-game-stats strong {
    color: white;
}

#easterCanvas {
    display: block;

    width: 100%;
    max-width: 500px;

    height: auto;

    margin: 0 auto;

    border-radius: 10px;

    border: 1px solid #333;

    background: #0b0b0b;
}

.easter-start-button {
    width: 100%;

    margin-top: 15px;

    min-height: 45px;

    border: none;
    border-radius: 9px;

    background: var(--creator-blue);

    color: white;

    font-weight: 700;

    cursor: pointer;
}

.easter-game-help {
    text-align: center;

    margin-top: 12px;

    color: #777;

    font-size: 11px;
}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 900px) {

    .creator-stats-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .status-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

}

@media (max-width: 650px) {

    .creator-header {
        padding: 15px;
    }

    .creator-header h1 {
        font-size: 17px;
    }

    .creator-content {
        width: min(100% - 24px, 1250px);

        padding-top: 18px;
    }

    .creator-stats-grid {
        grid-template-columns: 1fr;
    }

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

    .creator-panel {
        padding: 18px;
    }

    .creator-panel-header {
        flex-direction: column;
    }

    .creator-panel-header .primary-button {
        width: 100%;
    }

    .creator-project-card,
    .creator-timeline-card {
        align-items: stretch;

        flex-direction: column;
    }

    .creator-project-actions,
    .creator-timeline-actions {
        justify-content: flex-start;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .creator-password-card {
        padding: 27px;
    }

    .creator-editor-card {
        padding: 20px;
    }

}