/* 
 * The Shiltons Party - Custom Theme
 * Old-fashioned aesthetic with yellowed paper background
 */

:root {
    /* Color Palette */
    --color-paper: #f5e8d0; /* Fallback for paper background */
    --color-text-dark: #2c1810; /* Dark brown for text */
    --color-text-light: #5a4a3a; /* Lighter brown for secondary text */
    --color-accent-red: #c33a3a; /* Red for points of interest */
    --color-accent-red-dark: #a02d2d; /* Darker red for hover states */
    --color-inactive: #888888; /* Gray for inactive elements */
    --color-border: #2c1810; /* Black/brown for borders */
    
    /* Button Colors */
    --btn-default-color: var(--color-text-dark);
    --btn-default-bg: transparent;
    --btn-default-border: var(--color-border);
    
    --btn-inactive-color: var(--color-inactive);
    --btn-inactive-bg: transparent;
    --btn-inactive-border: var(--color-inactive);
    
    --btn-action-color: #ffffff;
    --btn-action-bg: var(--color-accent-red);
    --btn-action-border: var(--color-accent-red);
    
    /* Typography */
    --font-typewriter: 'Courier Prime', 'Courier New', monospace;
    --font-handwriting: 'Caveat', cursive, 'Brush Script MT', cursive;
    --font-fallback: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Base Styles */
body {
    background-image: url('/images/tan.jpg');
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    color: var(--color-text-dark);
    font-family: var(--font-fallback);
    min-height: 100vh;
    position: relative;
}

/* Paper overlay for better readability */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(245, 232, 208, 0.15); /* Slight paper tint overlay */
    z-index: -1;
}

/* Typography Classes */
.typewriter-font {
    font-family: var(--font-typewriter);
    letter-spacing: -0.5px;
}

.handwriting-font {
    font-family: var(--font-handwriting);
    font-weight: 500;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-typewriter);
    font-weight: 700;
    color: var(--color-text-dark);
}

/* Content Container */
.content-container {
    background-color: rgba(255, 255, 255, 0.85);
    border: 2px solid var(--color-border);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(44, 24, 16, 0.15);
    padding: 2rem;
    margin: 2rem auto;
    max-width: 1200px;
    position: relative;
}

/* Paper texture effect on content */
.content-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%232c1810' fill-opacity='0.03' fill-rule='evenodd'/%3E%3C/svg%3E");
    opacity: 0.3;
    pointer-events: none;
    border-radius: 6px;
    z-index: 0;
}

.content-container > * {
    position: relative;
    z-index: 1;
}

/* Custom Button Styles */
.btn-custom {
    font-family: var(--font-typewriter);
    font-weight: 700;
    border-width: 2px;
    border-style: solid;
    transition: all 0.2s ease;
    padding: 0.5rem 1.5rem;
}

/* Default button: black with clear background */
.btn-default {
    color: var(--btn-default-color);
    background-color: var(--btn-default-bg);
    border-color: var(--btn-default-border);
}

.btn-default:hover {
    background-color: rgba(44, 24, 16, 0.1);
    border-color: var(--color-text-dark);
    color: var(--color-text-dark);
}

.btn-default:active, .btn-default:focus {
    background-color: rgba(44, 24, 16, 0.2);
    border-color: var(--color-text-dark);
    color: var(--color-text-dark);
    box-shadow: 0 0 0 0.25rem rgba(44, 24, 16, 0.25);
}

/* Inactive button: gray */
.btn-inactive {
    color: var(--btn-inactive-color);
    background-color: var(--btn-inactive-bg);
    border-color: var(--btn-inactive-border);
    cursor: not-allowed;
    opacity: 0.7;
}

.btn-inactive:hover {
    color: var(--btn-inactive-color);
    background-color: var(--btn-inactive-bg);
    border-color: var(--btn-inactive-border);
    opacity: 0.7;
}

/* Action button: red (delete/cancel) */
.btn-action {
    color: var(--btn-action-color);
    background-color: var(--btn-action-bg);
    border-color: var(--btn-action-border);
}

.btn-action:hover {
    background-color: var(--color-accent-red-dark);
    border-color: var(--color-accent-red-dark);
    color: var(--btn-action-color);
}

.btn-action:active, .btn-action:focus {
    background-color: var(--color-accent-red-dark);
    border-color: var(--color-accent-red-dark);
    color: var(--btn-action-color);
    box-shadow: 0 0 0 0.25rem rgba(195, 58, 58, 0.5);
}

/* Form Styles */
.form-control, .form-select {
    font-family: var(--font-typewriter);
    border: 2px solid var(--color-border);
    background-color: rgba(255, 255, 255, 0.9);
}

.form-control:focus, .form-select:focus {
    border-color: var(--color-accent-red);
    box-shadow: 0 0 0 0.25rem rgba(195, 58, 58, 0.25);
    background-color: rgba(255, 255, 255, 0.95);
}

.form-label {
    font-family: var(--font-typewriter);
    font-weight: 700;
    color: var(--color-text-dark);
}

/* Custom Checkbox and Radio */
.form-check-input:checked {
    background-color: var(--color-accent-red);
    border-color: var(--color-accent-red);
}

.form-check-input:focus {
    border-color: var(--color-accent-red);
    box-shadow: 0 0 0 0.25rem rgba(195, 58, 58, 0.25);
}

/* Links */
a {
    color: var(--color-accent-red);
    text-decoration: none;
    font-weight: 700;
}

a:hover {
    color: var(--color-accent-red-dark);
    text-decoration: underline;
}

/* Accent Elements */
.accent-red {
    color: var(--color-accent-red);
}

.border-accent {
    border-color: var(--color-accent-red) !important;
}

/* Hand-drawn border effect */
.hand-drawn-border {
    border: 2px solid var(--color-border);
    border-radius: 255px 15px 225px 15px/15px 225px 15px 255px;
    padding: 1rem;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .content-container {
        padding: 1.5rem;
        margin: 1rem;
    }
    
    body {
        background-attachment: scroll;
    }
}

/* Landing Page Styles */
.landing-page {
    min-height: 100vh;
    position: relative;
}

/* Initial hidden state for sequential fade elements */
#welcome-text,
#ssgb-image,
#boarding-form {
    opacity: 0;
    visibility: hidden;
    transition: opacity 4s ease-in-out, visibility 0s 4s;
}

/* Speaker icon control */
.speaker-control {
    position: fixed;
    bottom: 80px;
    right: 20px;
    z-index: 1000;
    background-color: rgba(245, 232, 208, 0.9);
    border: 2px solid var(--color-border);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(44, 24, 16, 0.2);
    transition: all 0.2s ease;
}

.speaker-control:hover {
    background-color: rgba(245, 232, 208, 1);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(44, 24, 16, 0.3);
}

.speaker-control i {
    font-size: 1.5rem;
    color: var(--color-text-dark);
}

.speaker-control.muted i {
    color: var(--color-inactive);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(245, 232, 208, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.loading-container {
    text-align: center;
    max-width: 400px;
    padding: 2rem;
}

.loading-text {
    color: var(--color-text-dark);
    font-size: 1.2rem;
    letter-spacing: 1px;
}

/* Victorian Spinner */
.victorian-spinner {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto;
}

.spinner-outer-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 8px solid #b5a642; /* Brass color */
    border-radius: 50%;
    box-shadow: 
        inset 0 0 10px rgba(44, 24, 16, 0.3),
        0 4px 8px rgba(44, 24, 16, 0.2);
}

.spinner-inner-ring {
    position: absolute;
    width: 80%;
    height: 80%;
    top: 10%;
    left: 10%;
    border: 4px solid #2c1810; /* Dark etching */
    border-radius: 50%;
    border-style: double;
}

.spinner-center {
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #2c1810;
    border-radius: 50%;
    box-shadow: 0 0 5px rgba(44, 24, 16, 0.5);
}

.spinner-needle {
    position: absolute;
    width: 4px;
    height: 45px;
    background-color: #2c1810;
    top: 50%;
    left: 50%;
    transform-origin: bottom center;
    transform: translate(-50%, -100%) rotate(0deg);
    border-radius: 2px;
    box-shadow: 0 2px 4px rgba(44, 24, 16, 0.3);
    animation: spin-needle 4s linear infinite;
}

.spinner-needle::before {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    background-color: #c33a3a; /* Red accent */
    border-radius: 50%;
    top: -4px;
    left: 50%;
    transform: translateX(-50%);
}

.spinner-markings {
    position: absolute;
    width: 100%;
    height: 100%;
}

.marking {
    position: absolute;
    width: 2px;
    height: 12px;
    background-color: #2c1810;
    left: 50%;
    transform: translateX(-50%);
}

.marking-n {
    top: 5px;
}

.marking-e {
    top: 50%;
    right: 5px;
    left: auto;
    transform: translateY(-50%) rotate(90deg);
}

.marking-s {
    bottom: 5px;
}

.marking-w {
    top: 50%;
    left: 5px;
    transform: translateY(-50%) rotate(90deg);
}

@keyframes spin-needle {
    0% {
        transform: translate(-50%, -100%) rotate(0deg);
    }
    100% {
        transform: translate(-50%, -100%) rotate(360deg);
    }
}

/* Content Visibility */
.content-hidden {
    opacity: 0;
    visibility: hidden;
}

.content-visible {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.5s ease, visibility 0.5s;
}

/* Landing Page Typography */
.landing-page .handwriting-font.display-1 {
    font-size: 5rem;
    color: var(--color-text-dark);
    text-shadow: 2px 2px 4px rgba(44, 24, 16, 0.2);
    margin-bottom: 2rem !important;
}

/* Form Styling for Landing Page */
.landing-page .content-container {
    max-width: 800px;
    margin: 0 auto;
    animation: none; /* Remove any existing animations */
}

/* Get Started Button Container */
.get-started-container {
    margin-top: 2rem;
    text-align: center;
    transition: opacity 0.5s ease, visibility 0.5s;
}

.get-started-container.hidden {
    opacity: 0;
    visibility: hidden;
}

.get-started-container.visible {
    opacity: 1;
    visibility: visible;
}

/* Skip Animation Link */
.skip-animation-container {
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.skip-animation-container.visible {
    visibility: visible;
    opacity: 1;
}

.skip-animation-container.hidden {
    visibility: hidden;
    opacity: 0;
}

#skip-animation-link {
    color: var(--color-text-light);
    cursor: pointer;
}

#skip-animation-link:hover {
    color: var(--color-accent-red);
    text-decoration: underline;
}

/* Victorian Modal Styling */
.victorian-modal {
    background-color: rgba(255, 255, 255, 0.95);
    border: 3px solid var(--color-border);
    border-radius: 255px 15px 225px 15px/15px 225px 15px 255px;
    box-shadow: 0 8px 24px rgba(44, 24, 16, 0.25);
}

.victorian-modal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%232c1810' fill-opacity='0.03' fill-rule='evenodd'/%3E%3C/svg%3E");
    opacity: 0.3;
    pointer-events: none;
    border-radius: 255px 15px 225px 15px/15px 225px 15px 255px;
    z-index: 0;
}

.victorian-modal > * {
    position: relative;
    z-index: 1;
}

.victorian-modal .modal-header {
    border-bottom: 2px solid var(--color-border);
}

.victorian-modal .modal-footer {
    border-top: 1px solid var(--color-border);
}

.victorian-modal .btn-close {
    background-color: var(--color-text-light);
    opacity: 0.8;
    border-radius: 50%;
    width: 1.5rem;
    height: 1.5rem;
    background-size: 0.75rem;
    padding: 0.25rem;
    filter: invert(1);
}

.victorian-modal .btn-close:hover {
    opacity: 1;
    background-color: var(--color-accent-red);
    filter: invert(0);
}

.victorian-modal .modal-title {
    color: var(--color-text-dark);
    font-size: 1.5rem;
}

.victorian-modal #errorModalMessage {
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--color-text-dark);
}

.victorian-modal #countdown {
    font-weight: 700;
    color: var(--color-accent-red);
}

/* Admin Page Styles */
.admin-card {
    height: auto;
    min-height: 255px;
}

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

.admin-table .table-responsive {
    overflow-x: visible;
}

.admin-table td.text-end {
    white-space: nowrap;
}

.admin-table .btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.admin-table table td:nth-child(2) {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-table table th:nth-child(2) {
    max-width: 150px;
}

/* Clickable Guest Name Styles */
.clickable-guest-name {
    cursor: pointer;
    text-decoration: underline dotted var(--color-text-light);
    transition: all 0.2s ease;
}

.clickable-guest-name:hover {
    color: var(--color-accent-red);
    text-decoration: underline solid var(--color-accent-red);
    background-color: rgba(195, 58, 58, 0.05);
}

/* Print Styles */
@media print {
    body {
        background: white !important;
    }
    
    .content-container {
        background: white !important;
        border: 1px solid #ccc !important;
        box-shadow: none !important;
    }
    
    .btn-custom {
        border: 1px solid #000 !important;
        color: #000 !important;
        background: white !important;
    }
    
    .loading-overlay,
    .victorian-spinner,
    .get-started-container,
    .skip-animation-container,
    .victorian-modal {
        display: none !important;
    }
}
