/* Main styles - Notion-inspired design */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --color-bg: #fefcfc;
    --color-bg-secondary: #f5f0f0;
    --color-text: #2a1a1a;
    --color-text-light: #8b7070;
    --color-border: #e0d5d5;
    --color-accent: #FFA07A;
    --color-accent-light: #f5e8e0;
    --color-hover: #f0e8e5;
    --color-success: #9BD3AE;
    --color-error: #FF9A85;
    --color-blue-accent: #87CEEB;
    --color-blue-accent-light: #e8f0f7;
    --color-heading: #5a3e2b;
    --border-radius: 6px;
    --border-radius-sm: 4px;
    --border-radius-large: 12px;
    --font-family: 'Varela Round', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-family-heading: 'Shrikhand', cursive;
    --font-family-secondary: 'Varela Round', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-size-sm: 13px;
    --font-size-base: 15px;
    --font-size-lg: 17px;
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
}

/* Basic Reset & Body Styles */
html, body {
    height: 100%;
}

body {
    font-family: 'Varela Round', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

#app {
    min-height: 100vh;
    position: relative;
}

.canvas {
    min-height: 100vh;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
    padding-bottom: 80px; /* Space for bottom button */
    position: relative;
}

/* Utility classes */
.hidden {
    display: none !important;
}

/* Button styles */
button {
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.2s ease;
}

/* Close button animations */
.close-btn,
.settings-modal-close {
    transition: all 0.2s ease;
    position: relative;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius);
    background: transparent;
    border: none;
    font-size: 20px;
    font-weight: 500;
    color: var(--color-text-light);
    cursor: pointer;
    flex-shrink: 0;
}

.close-btn:hover,
.settings-modal-close:hover {
    transform: scale(1.1) rotate(90deg);
    color: var(--color-error);
    background: var(--color-hover);
}

.close-btn:active,
.settings-modal-close:active {
    transform: scale(0.95) rotate(90deg);
}

/* Add block button - Bottom bar style */
.add-block-btn {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 600px;
    height: 56px;
    background: white;
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-large);
    box-shadow: 
        0 14px 28px rgba(0, 0, 0, 0.18), 
        0 6px 12px rgba(0, 0, 0, 0.12),
        0 0 0 3px transparent,
        inset 0 0 0 3px transparent;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
    animation: wigBorderGlow 8s ease-in-out infinite;
}

.add-block-btn:hover {
    background: #f8f2ed;
    transform: translateX(-50%) translateY(-1px);
    box-shadow: 
        var(--shadow-lg), 
        0 -2px 8px rgba(0, 0, 0, 0.1),
        0 0 20px 2px var(--color-success),
        inset 0 0 0 2px var(--color-success);
    border-color: var(--color-success);
    animation: none;
}

.add-block-btn:active {
    transform: translateX(-50%) translateY(0);
    box-shadow: var(--shadow-md);
    animation: none;
}

.add-block-btn i {
    font-size: 16px;
    color: var(--color-accent);
    transition: transform 0.3s ease;
}

.add-block-btn:hover i {
    transform: rotate(180deg);
    color: var(--color-success);
}

.btn-text {
    font-size: var(--font-size-base);
    font-weight: 500;
    color: var(--color-text);
}

/* Settings button */
.settings-btn {
    position: fixed;
    top: calc(50px + var(--spacing-sm)); /* Account for page nav height */
    right: var(--spacing-md);
    background: white;
    border: 1px solid var(--color-border);
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: var(--font-size-sm);
    color: var(--color-text);
    box-shadow: var(--shadow-sm);
    z-index: 1002; /* Higher than page nav */
    transition: all 0.2s ease;
}

.settings-btn:hover {
    background: var(--color-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Project name input - DEPRECATED: Now handled by SiteManager */
.project-name-container {
    display: none !important;
}

.project-name-container:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
    border-color: var(--color-accent);
    background: #fdf9f7;
}

.project-name-label {
    font-size: var(--font-size-sm);
    color: var(--color-text-light);
    font-weight: 500;
}

.project-name-input {
    border: none;
    background: transparent;
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    color: var(--color-text);
    width: 150px;
}

.project-name-input:focus {
    outline: none;
}

/* Notification styles */
.notification {
    font-family: var(--font-family-secondary);
    position: fixed;
    top: 20px;
    right: 20px;
    padding: var(--spacing-md);
    border-radius: var(--border-radius);
    color: white;
    font-weight: 500;
    z-index: 10000;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    background: var(--color-success);
}

.notification.error {
    background: var(--color-error);
}

.notification.info {
    background: var(--color-accent);
}

/* Save indicator */
.save-indicator {
    position: fixed;
    bottom: 20px;
    left: 20px;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--color-success);
    color: white;
    border-radius: var(--border-radius);
    font-size: var(--font-size-sm);
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.save-indicator.show {
    opacity: 1;
    transform: translateY(0);
}

/* Publish Dialog */
.publish-dialog-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10002;
    animation: fadeIn 0.2s ease-out;
}

.publish-dialog-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s ease-out;
}

.publish-dialog-header {
    padding: 24px;
    border-bottom: 1px solid var(--color-border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.publish-dialog-title {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: var(--color-text);
}

.publish-dialog-close {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--color-text-secondary);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
}

.publish-dialog-close:hover {
    background: var(--color-bg);
    color: var(--color-text);
}

.publish-dialog-body {
    padding: 24px;
    overflow-y: auto;
}

.publish-instructions {
    margin: 0 0 24px 0;
    color: var(--color-text-secondary);
    line-height: 1.5;
}

.publish-input-group {
    margin-bottom: 20px;
}

.publish-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--color-text);
}

.publish-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s;
}

.publish-input:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(212, 145, 98, 0.1);
}

.publish-hint {
    display: block;
    margin-top: 6px;
    color: var(--color-text-secondary);
    font-size: 12px;
    line-height: 1.4;
}

.publish-buttons {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--color-border-light);
}

.publish-btn {
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.publish-btn-cancel {
    background: var(--color-bg);
    color: var(--color-text);
    border-color: var(--color-border);
}

.publish-btn-cancel:hover {
    background: var(--color-hover);
}

.publish-btn-primary {
    background: var(--color-accent);
    color: white;
}

.publish-btn-primary:hover:not(:disabled) {
    background: #b8754a;
}

.publish-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Settings Modal */
.settings-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.settings-modal-content {
    background: white;
    border-radius: var(--border-radius-large);
    box-shadow: var(--shadow-lg);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    animation: slideInUp 0.3s ease;
}

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

.settings-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--color-border);
    background: var(--color-bg);
}

.settings-modal-header h2 {
    font-family: 'Varela Round', sans-serif;
    margin: 0;
    font-weight: 700;
}

.settings-modal-title {
    font-family: var(--font-family-heading);
    margin: 0;
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--color-heading);
}

.settings-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--color-text-light);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--border-radius);
    transition: all 0.2s ease;
}

.settings-modal-close:hover {
    background: var(--color-hover);
    color: var(--color-text);
}

.settings-modal-body {
    padding: var(--spacing-lg);
    max-height: 60vh;
    overflow-y: auto;
}

/* Settings Sections */
.settings-section {
    margin-bottom: var(--spacing-xl);
}

.settings-section:last-child {
    margin-bottom: 0;
}

.settings-section-header {
    font-family: 'Varela Round', sans-serif;
    margin: 0 0 var(--spacing-md) 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-heading);
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--color-border);
}

.settings-section-content {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

/* Action Buttons */
.settings-action-item {
    margin-bottom: var(--spacing-sm);
}

.settings-action-button {
    width: 100%;
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.settings-action-button:hover {
    background: var(--color-bg);
    border-color: var(--color-accent);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.settings-action-primary {
    background: var(--color-accent);
    color: white;
    border-color: var(--color-accent);
}

.settings-action-primary:hover {
    background: #b8754a;
    border-color: #b8754a;
}


.settings-action-default {
    border-color: var(--color-border);
    color: var(--color-text);
}

.settings-action-default:hover {
    background: var(--color-bg);
    border-color: var(--color-accent);
    color: var(--color-accent);
}

.settings-action-danger {
    border-color: var(--color-error);
    color: var(--color-error);
}

.settings-action-danger:hover {
    background: #fdf0ed;
    border-color: var(--color-error);
}

.settings-action-secondary:hover {
    background: var(--color-hover);
}

.settings-action-icon {
    font-size: 20px;
    min-width: 24px;
    text-align: center;
}

.settings-action-content {
    flex: 1;
}

.settings-action-label {
    font-weight: 500;
    margin-bottom: 2px;
}

.settings-action-description {
    font-family: var(--font-family-secondary);
    font-size: var(--font-size-sm);
    color: var(--color-text-light);
    line-height: 1.4;
}

/* Animation Action Buttons */
.settings-animation-actions {
    display: flex;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
}

.settings-animation-actions .settings-action-button {
    flex: 1;
    justify-content: center;
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: var(--font-size-sm);
}

/* Control Groups */
.settings-control-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.settings-control-label {
    font-weight: 500;
    font-size: var(--font-size-sm);
    color: var(--color-text);
}

.settings-control-input {
    padding: var(--spacing-xs);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
}

.settings-control-input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.settings-control-range-container {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.settings-control-range {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    background: var(--color-bg-secondary);
    border-radius: 3px;
    outline: none;
}

.settings-control-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--color-accent);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.settings-control-range::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 0 0 4px rgba(210, 141, 93, 0.2);
}

.settings-control-range::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--color-accent);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.settings-control-range::-moz-range-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 0 0 4px rgba(210, 141, 93, 0.2);
}

.settings-control-range-value {
    min-width: 60px;
    text-align: right;
    font-weight: 500;
    color: var(--color-accent);
    font-size: var(--font-size-sm);
}

.settings-control-description {
    font-family: var(--font-family-secondary);
    font-size: var(--font-size-sm);
    color: var(--color-text-light);
    line-height: 1.4;
    margin-top: 2px;
}

.settings-notice {
    font-family: var(--font-family-secondary);
    padding: var(--spacing-md);
    background: var(--color-bg-secondary);
    border-radius: var(--border-radius);
    color: var(--color-text-light);
    text-align: center;
    font-style: italic;
}

/* Responsive */
@media (max-width: 768px) {
    .settings-modal-content {
        width: 95%;
        margin: var(--spacing-md);
        max-height: 90vh;
    }
    
    .settings-modal-header,
    .settings-modal-body {
        padding: var(--spacing-md);
    }
    
    .settings-animation-actions {
        flex-direction: column;
    }
}

/* Block styles */
.block {
    position: relative;
    border: 1px solid transparent;
    transition: border-color 0.2s ease;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Exception for navbar blocks to allow dropdowns */
.navbar-block.block {
    overflow: visible !important;
}

.block:hover {
    border-color: var(--color-blue-accent);
}

.block-edit-overlay {
    position: absolute;
    top: 4px;
    right: 4px;
    display: flex;
    gap: 4px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    padding: 4px;
    box-shadow: var(--shadow-md);
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    transform: translateY(-5px);
    z-index: 150;
}

.block:hover .block-edit-overlay {
    opacity: 1;
    transform: translateY(0);
}

.block-edit-btn,
.block-add-btn,
.block-delete-btn,
.block-section-color-btn {
    width: 28px;
    height: 28px;
    font-size: 14px;
    background: transparent;
    border: none;
    color: var(--color-text-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius);
}

.block-edit-btn:hover,
.block-add-btn:hover,
.block-delete-btn:hover {
    background: var(--color-hover);
    color: var(--color-text);
}

.block-content {
    padding: 0;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

/* Exception for navbar blocks to allow dropdowns */
.navbar-block .block-content {
    overflow: visible !important;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .canvas {
        padding: 0;
        padding-bottom: 80px; /* Extra padding for bottom button */
    }
    
    .add-block-btn {
        width: 95%;
        height: 60px;
        border-radius: var(--border-radius-large);
        font-size: var(--font-size-sm);
    }
    
    .export-btn,
    .clear-btn,
    .project-name-container {
        position: relative;
        top: auto;
        left: auto;
        right: auto;
        margin: var(--spacing-sm);
        width: calc(100% - 2 * var(--spacing-sm));
    }
}

/* Font Management Styles */
.fonts-info {
    font-family: var(--font-family-secondary);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--color-bg);
    border-radius: var(--border-radius);
    border: 1px solid var(--color-border);
}

.font-info-item {
    font-family: var(--font-family-secondary);
    font-size: var(--font-size-sm);
    color: var(--color-text-light);
}

.font-info-item strong {
    color: var(--color-text);
}

.custom-fonts-container {
    margin-bottom: var(--spacing-md);
}

.settings-subsection-label {
    font-weight: 500;
    font-size: var(--font-size-sm);
    color: var(--color-text);
    margin-bottom: var(--spacing-sm);
}

.custom-fonts-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    padding: var(--spacing-sm);
    background: var(--color-bg);
}

.custom-fonts-empty {
    text-align: center;
    color: var(--color-text-light);
    font-style: italic;
    padding: var(--spacing-md);
}

.custom-font-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-sm);
    margin-bottom: var(--spacing-xs);
    background: white;
    border-radius: var(--border-radius);
    border: 1px solid var(--color-border);
    transition: all 0.2s ease;
}

.custom-font-item:hover {
    border-color: var(--color-accent);
    box-shadow: var(--shadow-sm);
}

.custom-font-item:last-child {
    margin-bottom: 0;
}

.custom-font-name {
    font-size: var(--font-size-sm);
    color: var(--color-text);
    flex: 1;
}

.custom-font-remove {
    width: 24px;
    height: 24px;
    padding: 0;
    background: transparent;
    border: none;
    color: var(--color-text-light);
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius);
    transition: all 0.2s ease;
}

.custom-font-remove:hover {
    background: var(--color-error);
    color: white;
    transform: scale(1.1);
}

.font-upload-container {
    display: flex;
    gap: var(--spacing-sm);
}

.settings-success-message,
.settings-error-message {
    font-family: var(--font-family-secondary);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--border-radius);
    font-size: var(--font-size-sm);
    margin-top: var(--spacing-sm);
    animation: slideInFade 0.3s ease;
}

.settings-success-message {
    background: #f0ebe6;
    color: #8b6c47;
    border: 1px solid #c69f7a;
}

.settings-error-message {
    background: #fdf0ed;
    color: #b5402d;
    border: 1px solid #d4654c;
}

@keyframes slideInFade {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Home Page Styles */
.home-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 4rem 0;
    background: linear-gradient(to bottom, #fafafa, #f5f5f5);
    position: relative;
    flex-grow: 1;
}

.home-header {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInDown 0.8s ease-out;
}

.home-logo-container {
    margin-bottom: 1.5rem;
    cursor: pointer;
    display: inline-block;
    position: relative;
}

.home-logo {
    max-width: 150px;
    width: 100%;
    height: auto;
    transition: transform 0.3s ease, filter 0.3s ease;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

.home-logo:hover {
    transform: scale(1.1) translateY(-5px);
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.15));
}

.home-title {
    font-family: var(--font-family-heading);
    font-size: 3.5rem;
    font-weight: 600;
    color: #2d2d2d;
    margin: 0 0 0.5rem 0;
    cursor: pointer;
    transition: transform 0.2s ease;
    letter-spacing: -0.02em;
}

.home-title:hover {
    transform: scale(1.02);
}

.home-title-letter {
    display: inline-block;
    animation-duration: 2.5s;
    animation-timing-function: ease-in-out;
    animation-fill-mode: forwards;
}

.home-title-letter.letter-0 {
    animation-name: bounceColorWave1;
    animation-delay: 0s;
}

.home-title-letter.letter-1 {
    animation-name: bounceColorWave2;
    animation-delay: 0s;
}

.home-title-letter.letter-2 {
    animation-name: bounceColorWave3;
    animation-delay: 0s;
}

@keyframes bounceColorWave1 {
    0% { transform: translateY(0); color: #ff9a85; }
    16% { transform: translateY(-8px); color: #b5a7d6; }
    20% { transform: translateY(0); color: #9bd3ae; }
    36% { transform: translateY(0); color: #e8a4a0; }
    52% { transform: translateY(0); color: #87ceeb; }
    68% { transform: translateY(-8px); color: #ffb8a3; }
    72% { transform: translateY(0); color: #a8c09a; }
    88% { transform: translateY(0); color: #e8a4a0; }
    100% { transform: translateY(0); color: var(--color-heading); }
}

@keyframes bounceColorWave2 {
    0% { transform: translateY(0); color: #a8c09a; }
    16% { transform: translateY(0); color: #87ceeb; }
    20% { transform: translateY(0); color: #ff9a85; }
    36% { transform: translateY(-8px); color: #e8a4a0; }
    40% { transform: translateY(0); color: #9bd3ae; }
    56% { transform: translateY(0); color: #b5a7d6; }
    68% { transform: translateY(0); color: #ffb8a3; }
    84% { transform: translateY(-8px); color: #87ceeb; }
    88% { transform: translateY(0); color: #9bd3ae; }
    100% { transform: translateY(0); color: var(--color-heading); }
}

@keyframes bounceColorWave3 {
    0% { transform: translateY(0); color: #87ceeb; }
    16% { transform: translateY(0); color: #ffb8a3; }
    20% { transform: translateY(0); color: #a8c09a; }
    36% { transform: translateY(0); color: #ff9a85; }
    40% { transform: translateY(0); color: #b5a7d6; }
    52% { transform: translateY(-8px); color: #9bd3ae; }
    56% { transform: translateY(0); color: #e8a4a0; }
    72% { transform: translateY(0); color: #ff9a85; }
    88% { transform: translateY(0); color: #b5a7d6; }
    96% { transform: translateY(-8px); color: #e8a4a0; }
    100% { transform: translateY(0); color: var(--color-heading); }
}

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

.home-subtitle {
    font-family: var(--font-family-secondary);
    font-size: 1.25rem;
    color: #666;
    font-weight: 400;
    margin: 0;
    font-weight: 400;
    margin-bottom: 0; /* No bottom margin since header is absolutely positioned */
}

.sites-container {
    width: 100%;
    max-width: 1400px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    min-height: 450px;
    position: relative;
}

.sites-grid {
    display: flex;
    gap: 2rem;
    flex-wrap: nowrap;
    overflow-x: visible;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    min-width: fit-content;
}

/* Pseudo-elements to ensure first and last items don't get cut off */
.sites-grid::before,
.sites-grid::after {
    content: '';
    width: 1px; /* Minimal width, padding handles the space */
    height: 1px;
    flex-shrink: 0;
}

.sites-grid.empty {
    justify-content: center; /* Center horizontally */
    align-items: center; /* Center vertically */
    width: 100%; /* Take full width of container */
    height: 100%; /* Take full height of container */
    margin-top: 0; /* Remove top margin when empty */
    padding: var(--spacing-md); /* Uniform padding when empty */
}

.sites-grid > * {
    scroll-snap-align: start; /* Snap each card to the start */
    flex-shrink: 0; /* Prevent cards from shrinking */
}

.site-card {
    min-width: 300px;
    height: 340px;
    background: white;
    border: 1px solid #e5e5e5;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    overflow: hidden;
    position: relative;
}

.site-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
    border-color: #d0d0d0;
}

.site-thumbnail {
    width: 100%;
    height: 200px;
    background: var(--color-bg-secondary);
    border-radius: var(--border-radius-large) var(--border-radius-large) 0 0;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Random color thumbnails for active sites */
.site-thumbnail.color-coral {
    background: linear-gradient(135deg, #ff9a85, #ffad99);
}

.site-thumbnail.color-sage {
    background: linear-gradient(135deg, #a8c09a, #bdd0ac);
}

.site-thumbnail.color-lavender {
    background: linear-gradient(135deg, #b5a7d6, #c7b8e8);
}

.site-thumbnail.color-peach {
    background: linear-gradient(135deg, #ffb8a3, #ffc9b8);
}

.site-thumbnail.color-mint {
    background: linear-gradient(135deg, #9bd3ae, #b1e0c4);
}

.site-thumbnail.color-rose {
    background: linear-gradient(135deg, #e8a4a0, #f0b8b5);
}

.site-thumbnail.color-sky {
    background: linear-gradient(135deg, #87ceeb, #a6d8f0);
}

.site-thumbnail.color-sunset {
    background: linear-gradient(135deg, #ffa07a, #ffb89a);
}

.site-thumbnail.color-forest {
    background: linear-gradient(135deg, #8fbc8f, #a3d0a3);
}

.site-thumbnail.color-cream {
    background: linear-gradient(135deg, #f5deb3, #f8e6c8);
}

.site-thumbnail-preview {
    width: 100%;
    height: 100%;
    transform: scale(0.3);
    transform-origin: top left;
    overflow: hidden;
    border: none;
    background: white;
}

.site-info {
    padding: var(--spacing-md);
    height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.site-name {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: var(--spacing-xs);
    word-break: break-word;
}

.site-name-input {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--color-text);
    border: none;
    background: transparent;
    width: 100%;
    outline: none;
    font-family: var(--font-family);
}

.site-name-input:focus {
    background: var(--color-bg-secondary);
    border-radius: var(--border-radius);
    padding: var(--spacing-xs);
}

.site-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-date {
    font-family: var(--font-family-secondary);
    font-size: var(--font-size-sm);
    color: var(--color-text-light);
}

.site-actions {
    display: flex;
    gap: var(--spacing-xs);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.site-card:hover .site-actions {
    opacity: 1;
}

.site-action-btn {
    width: 24px;
    height: 24px;
    border: none;
    background: var(--color-bg-secondary);
    border-radius: var(--border-radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.2s ease;
}

.site-action-btn:hover {
    background: var(--color-accent);
    color: white;
    transform: scale(1.1);
}

/* Empty state card - Create New Site */
.empty-state-card {
    border: 2px dashed #d0d0d0 !important;
    background: rgba(255, 255, 255, 0.5) !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    position: relative;
    overflow: hidden;
}

.empty-state-card:hover {
    border-color: #a0a0a0 !important;
    background: white !important;
}

.empty-state-card-icon {
    font-size: 3rem;
    color: #667eea;
    font-weight: 300;
    transition: all 0.3s ease;
}

.empty-state-card:hover .empty-state-card-icon {
    transform: scale(1.2);
    color: #764ba2;
}

.empty-state-card-text {
    font-family: var(--font-family-secondary);
    font-size: 1.1rem;
    color: #555;
    font-weight: 500;
    letter-spacing: 0.01em;
}

/* Custom scrollbar for sites container */
.sites-container::-webkit-scrollbar {
    height: 8px;
}

.sites-container::-webkit-scrollbar-track {
    background: var(--color-bg-secondary);
    border-radius: 4px;
}

.sites-container::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 4px;
}

.sites-container::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-light);
}

/* Add site card styling */
.add-site-card {
    min-width: 280px; /* Match site-card width */
    height: 320px; /* Match site-card height */
    background: var(--color-bg-secondary);
    border: 2px dashed var(--color-border);
    border-radius: var(--border-radius-large);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.add-site-card:hover {
    border-color: var(--color-accent);
    background: var(--color-accent-light);
    transform: translateY(-2px);
}

.add-site-icon {
    font-size: 3rem;
    color: var(--color-text-light);
    margin-bottom: var(--spacing-sm);
    transition: all 0.3s ease;
}

.add-site-card:hover .add-site-icon {
    color: var(--color-accent);
    transform: scale(1.1);
}

.add-site-text {
    font-family: var(--font-family-secondary);
    font-size: var(--font-size-lg);
    font-weight: 500;
    color: var(--color-text-light);
    transition: all 0.3s ease;
}

.add-site-card:hover .add-site-text {
    color: var(--color-accent);
}

/* Empty state card styling - now integrated into sites grid */
.empty-state-card {
    width: 280px; /* Match site-card width */
    height: 320px; /* Match site-card height */
    background: var(--color-bg-secondary);
    border: 2px dashed var(--color-border);
    border-radius: var(--border-radius-large);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: 
        0 0 0 3px transparent,
        inset 0 0 0 3px transparent;
    animation: wigBorderGlow 8s ease-in-out infinite;
}

@keyframes wigBorderGlow {
    0% {
        box-shadow: 
            0 0 12px 1px #ff9a85,
            inset 0 0 0 2px #ff9a85;
    }
    14% {
        box-shadow: 
            0 0 12px 1px #b5a7d6,
            inset 0 0 0 2px #b5a7d6;
    }
    28% {
        box-shadow: 
            0 0 12px 1px #9bd3ae,
            inset 0 0 0 2px #9bd3ae;
    }
    42% {
        box-shadow: 
            0 0 12px 1px #e8a4a0,
            inset 0 0 0 2px #e8a4a0;
    }
    57% {
        box-shadow: 
            0 0 12px 1px #87ceeb,
            inset 0 0 0 2px #87ceeb;
    }
    71% {
        box-shadow: 
            0 0 12px 1px #ffb8a3,
            inset 0 0 0 2px #ffb8a3;
    }
    85% {
        box-shadow: 
            0 0 12px 1px #a8c09a,
            inset 0 0 0 2px #a8c09a;
    }
    100% {
        box-shadow: 
            0 0 12px 1px #ff9a85,
            inset 0 0 0 2px #ff9a85;
    }
}


.empty-state-card:hover {
    border-color: var(--color-accent);
    background: var(--color-accent-light);
    transform: translateY(-2px); /* Match add-site-card hover transform */
}

.empty-state-card-icon {
    font-size: 3rem;
    color: var(--color-text-light);
    margin-bottom: var(--spacing-md);
    transition: all 0.3s ease;
}

.empty-state-card:hover .empty-state-card-icon {
    color: var(--color-accent);
    transform: scale(1.1);
}

.empty-state-card-text {
    font-family: var(--font-family-secondary);
    font-size: var(--font-size-lg);
    font-weight: 500;
    color: var(--color-text-light);
    transition: all 0.3s ease;
}

.empty-state-card:hover .empty-state-card-text {
    color: var(--color-accent);
}

/* Home button in editor - matches settings button style exactly */
.home-btn {
    position: fixed;
    top: calc(50px + var(--spacing-sm)); /* Same as settings button */
    left: var(--spacing-md);
    background: white;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    padding: var(--spacing-sm) var(--spacing-md);
    box-shadow: var(--shadow-sm);
    z-index: 1002; /* Same as settings button */
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    color: var(--color-text);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.home-btn:hover {
    background: var(--color-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Editor container when active */
.editor {
    min-height: 100vh;
    position: relative;
}

/* Responsive design */
@media (max-width: 768px) {
    .home-page {
        padding: var(--spacing-lg);
        flex-direction: column;
        justify-content: flex-start; /* Change to flex-start to accommodate header */
        padding-top: calc(var(--spacing-lg) * 8); /* Add top padding for header space */
    }
    
    .home-header {
        position: absolute;
        top: var(--spacing-lg); /* Move closer to top on mobile */
        left: 50%;
        transform: translateX(-50%);
        margin-top: 0;
        margin-bottom: 0;
    }
    
    .home-title {
        font-size: 2.5rem;
    }
    
    .sites-container {
        flex: none;
        width: calc(100% - 2 * var(--spacing-lg)); /* Smaller margin on mobile */
    }
    
    .sites-grid {
        justify-content: flex-start; /* Keep start alignment for scrolling */
        padding: var(--spacing-md) var(--spacing-lg); /* Smaller padding on mobile */
    }
    
    .site-card,
    .add-site-card {
        width: 100%;
        max-width: 320px;
    }
    
    .home-btn {
        position: relative;
        top: auto;
        left: auto;
        margin: var(--spacing-sm);
        width: calc(100% - 2 * var(--spacing-sm));
    }
}
