/* ===== FONTS ===== */
@font-face {
    font-family: 'Command Prompt 06x08';
    src: url('../fonts/command-prompt.otf') format('opentype');
}

@font-face {
    font-family: 'Nimbus Sans';
    src: url('../fonts/NimbusSans-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}

/* ===== BASE STYLES ===== */
html {
    background-color: black;
}

body {
    margin: 0;
    padding: 1.25rem;
    background-image: url('../images/bg9.jpg');
    font-family: 'Nimbus Sans', sans-serif;
    font-weight: 400;
    font-size: 16px;
    color: #000000;
    min-height: 100vh;
    box-sizing: border-box;
}

body.page-rsvp {
    background-image: url('../images/bg10.jpg');
}

a {
    color: #0000ee;
    text-decoration: underline;
}

a:visited {
    color: #551a8b;
}

a:hover {
    color: #000080;
    background: transparent;
}

p {
    line-height: 1.6;
    margin: 0.75rem 0;
}

pre {
    font-family: inherit !important;
    font-size: inherit !important;
    margin: 0;
}

/* ===== UTILITY CLASSES ===== */

/* Display */
.block { display: block; }
.inline-block { display: inline-block; }
.flex { display: flex; }
.hidden { display: none; }

/* Flexbox */
.flex-col { flex-direction: column; }
.flex-shrink-0 { flex-shrink: 0; }
.flex-grow { flex-grow: 1; }
.items-start { align-items: flex-start; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.gap-5 { gap: 1.25rem; }

/* Width */
.w-full { width: 100%; }
.w-140 { width: 140px; }
.w-60 { width: 60px; }
.min-w-0 { min-width: 0; }
.max-w-900 { max-width: 900px; }

/* Height */
.h-50 { height: 50px; }

/* Margin */
.m-0 { margin: 0; }
.m-auto { margin: auto; }
.mx-auto { margin-left: auto; margin-right: auto; }
.my-1 { margin-top: 0.25rem; margin-bottom: 0.25rem; }
.my-2 { margin-top: 0.5rem; margin-bottom: 0.5rem; }
.my-4 { margin-top: 1rem; margin-bottom: 1rem; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-5 { margin-top: 1.25rem; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-5 { margin-bottom: 1.25rem; }
.mb-6 { margin-bottom: 1.5rem; }
.ml-2 { margin-left: 0.5rem; }
.mx-1 { margin-left: 0.25rem; margin-right: 0.25rem; }

/* Padding */
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.pt-3 { padding-top: 0.75rem; }

/* Text */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-xs { font-size: 12px; }
.text-sm { font-size: 14px; }
.text-base { font-size: 16px; }
.text-lg { font-size: 18px; }
.text-xl { font-size: 22px; }
.text-2xl { font-size: 32px; }
.font-bold { font-weight: bold; }
.underline { text-decoration: underline; }
.uppercase { text-transform: uppercase; }
.leading-none { line-height: 1; }
.tracking-wide { letter-spacing: 2px; }

/* Colors */
.text-white { color: #ffffff; }
.text-black { color: #000000; }
.text-blue { color: #0000ee; }
.text-blue-dark { color: #000080; }
.text-green { color: #00ff00; }
.text-red { color: red; }
.text-gray { color: #888; }
.text-gray-dark { color: #333; }
.bg-white { background: #ffffff; }
.bg-black { background: #000000; }
.bg-gray { background: #c9c9c9; }
.bg-gray-light { background: #f5f5f5; }
.bg-gray-medium { background: #f0f0f0; }
.bg-linen { background: linen; }

/* Borders */
.border { border: 1px solid #808080; }
.border-2 { border: 2px solid #808080; }
.border-3 { border: 3px solid #808080; }
.border-t { border-top: 1px solid #eee; }
.border-gray { border-color: #808080; }
.border-gray-light { border-color: #ddd; }
.border-ccc { border-color: #ccc; }
.border-dashed { border-style: dashed; }
.border-none { border: none; }
.border-collapse { border-collapse: collapse; }
.rounded { border-radius: 3px; }
.rounded-b { border-radius: 0 0 3px 3px; }

/* Shadows */
.shadow { box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.1); }
.shadow-inset { box-shadow: inset 1px 1px 3px rgba(0,0,0,0.8); }
.shadow-dropdown { box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); }

/* Positioning */
.relative { position: relative; }
.absolute { position: absolute; }
.top-full { top: 100%; }
.left-0 { left: 0; }
.right-0 { right: 0; }

/* Overflow */
.overflow-auto { overflow-y: auto; }
.max-h-200 { max-height: 200px; }

/* Z-index */
.z-100 { z-index: 100; }

/* Cursor */
.cursor-pointer { cursor: pointer; }

/* Box sizing */
.box-border { box-sizing: border-box; }

/* Vertical align */
.align-middle { vertical-align: middle; }

/* ===== COMPONENT STYLES ===== */

/* Header link wrapper */
.header-link {
    display: block;
    text-decoration: none;
}

/* Header border pattern */
.header-border {
    background-image: url('../images/bordertapestry.jpg');
    background-repeat: repeat-x;
    background-size: auto 100%;
}

/* Navigation menu - win98 style card */
.nav-menu {
    background-image: url('../images/bg11.jpg');
    background-repeat: repeat;
    border: 3px solid #808080;
    border-left-color: white;
    border-top-color: white;
    border-bottom-color: #575757;
    border-right-color: #575757;
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.1);
    width: 140px;
    box-sizing: border-box;
}

.nav-menu-header {
    background: linear-gradient(to right, #000080, #1084d0);
    color: #ffffff;
    padding: 0.3rem 0.75rem;
    font-weight: bold;
}

.nav-menu ul {
    list-style: none;
    margin: 0;
    padding: 0.5rem 0;
}

.nav-menu li {
    margin: 0;
}

.nav-menu a {
    display: block;
    padding: 0.15rem 0.75rem;
    color: #0000ee;
    text-decoration: underline;
    line-height: 1;
}

.nav-menu a:visited {
    color: #0000ee;
}

/* Main content area - card */
.main-content {
    background: linen;
    border: 1px solid #808080;
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.1);
    background-image: url('/images/texture_tan.gif');
    background-repeat: repeat;
    padding: 1.25rem;
    flex-grow: 1;
    min-width: 0;
}

/* Pic of the day box */
.pic-of-the-day {
    margin-top: 1rem;
    width: 140px;
    box-sizing: border-box;
}

.pic-of-the-day-header {
    background: #ffffff;
    border: 1px solid #808080;
    padding: 0.25rem 0.5rem;
    text-align: center;
}

.pic-of-the-day img {
    width: 100%;
    display: block;
    border: 1px solid #808080;
    border-top: none;
    box-sizing: border-box;
}

/* Details table */
.details-table {
    background: white;
    border: none;
    border-collapse: collapse;
    width: 100%;
}

.details-table td {
    padding: 0.625rem;
    border: 1px solid #ddd;
}

.details-table .label {
    font-weight: bold;
    color: #000000;
    width: 140px;
    background: #f5f5f5;
}

/* Visitor counter */
.counter {
    background: #000000;
    color: #00ff00;
    font-size: 16px;
    padding: 0.25rem 0.75rem;
    display: inline-block;
    border: 2px groove #808080;
    letter-spacing: 2px;
    box-shadow: inset 1px 1px 3px rgba(0,0,0,0.8);
}

/* Fancy header */
.fancy-header {
    color: #ff00ff;
    text-align: center;
    font-size: 2rem;
    margin: 1rem 0;
    text-shadow: 3px 3px 0 #00ffff, -2px -2px 0 #ffff00;
    font-weight: bold;
    animation: rainbow 2s infinite;
    text-transform: uppercase;
}

@keyframes rainbow {
    0% { color: #ff0000; }
    16% { color: #ff8800; }
    33% { color: #ffff00; }
    50% { color: #00ff00; }
    66% { color: #0088ff; }
    83% { color: #8800ff; }
    100% { color: #ff0000; }
}

/* Fancy HR */
.fancy-hr {
    border: 0;
    height: 5px;
    background: repeating-linear-gradient(
        90deg,
        #ff0000,
        #ff0000 10px,
        #ffff00 10px,
        #ffff00 20px,
        #00ff00 20px,
        #00ff00 30px,
        #00ffff 30px,
        #00ffff 40px
    );
    margin: 1.25rem 0;
}

/* Guestbook entry */
.entry {
    background: #ffffff;
    border: 3px dashed black;
    border-radius: 3px;
    padding: 0.75rem;
    margin: 0.5rem 0;
    font-size: 0.9rem;
}

.entry strong {
    color: #000080;
}

.entry em {
    color: #888;
    font-size: 12px;
}

/* Guest search autocomplete */
.guest-search-container {
    position: relative;
    width: 100%;
}

.guest-suggestions {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border: 2px solid black;
    border-top: none;
    border-radius: 0 0 3px 3px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.guest-suggestion {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    font-size: 14px;
}

.guest-suggestion:hover,
.guest-suggestion.active {
    background: #000080;
    color: #ffffff;
}

/* Details/Summary accordion */
details {
    margin-top: 0.4rem;
    line-height: 1;
}

details div {
    border: 3px dashed black;
    padding: 1rem;
    border-radius: 3px;
    background-color: white;
    line-height: 1.2;
}

summary {
    cursor: pointer;
    margin-bottom: 0.3rem;
}

summary:hover {
    color: blue;
}

/* Admin table */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    font-size: 14px;
}

.admin-table th,
.admin-table td {
    padding: 0.5rem 0.75rem;
    border: 1px solid #ddd;
    text-align: left;
}

.admin-table th {
    background: #000080;
    color: white;
}

.admin-table tr:nth-child(even) {
    background: #f5f5f5;
}

.attending-yes {
    color: green;
    font-weight: bold;
}

.attending-no {
    color: red;
}

/* ===== FORM STYLES ===== */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: 0.5rem;
    border: 2px solid black;
    border-radius: 3px;
    background: #ffffff;
    box-sizing: border-box;
    font-size: 14px;
    font-family: inherit;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #000080;
    box-shadow: 0 0 3px rgba(0, 0, 128, 0.3);
}

input[type="checkbox"],
input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: 1rem;
    height: 1rem;
    border: 2px solid black;
    background: #ffffff;
    vertical-align: middle;
    cursor: pointer;
}

input[type="checkbox"] {
    border-radius: 2px;
}

input[type="radio"] {
    border-radius: 50%;
}

input[type="checkbox"]:checked,
input[type="radio"]:checked {
    background: #000080;
    border-color: #000080;
}

input[type="checkbox"]:checked::after {
    content: '';
    display: block;
    width: 0.25rem;
    height: 0.5rem;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin: 0 auto;
}

input[type="radio"]:checked::after {
    content: '';
    display: block;
    width: 0.375rem;
    height: 0.375rem;
    background: white;
    border-radius: 50%;
    margin: 0.1875rem auto;
}

button,
.btn {
    background: #000080;
    color: #ffffff;
    border: none;
    border-radius: 3px;
    padding: 0.5rem 1rem;
    font-size: 14px;
    cursor: pointer;
    font-family: inherit;
}

button:hover,
.btn:hover {
    background: #0000a0;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    * {
        max-width: 100%;
        box-sizing: border-box;
    }

    body {
        padding: 0.625rem;
        overflow-x: hidden;
    }

    .header-border {
        height: 30px;
        margin-bottom: 0.5rem;
    }

    .hide-mobile {
        display: none;
    }

    .flex-col-mobile {
        flex-direction: column;
        gap: 0.75rem;
    }

    .nav-wrapper {
        width: 100%;
    }

    .nav-row {
        display: flex;
        gap: 0.75rem;
    }

    .nav-row .nav-menu,
    .nav-row .pic-of-the-day {
        flex: 1;
        width: auto;
        margin-top: 0;
    }

    .nav-row .pic-of-the-day {
        display: flex;
        flex-direction: column;
    }

    .nav-row .pic-of-the-day img {
        flex: 1;
        object-fit: contain;
        background-color: black;
    }

    .nav-menu ul {
        display: flex;
        flex-direction: column;
        padding: 0.5rem;
        gap: 0;
    }

    .nav-menu li {
        width: 100%;
    }

    .nav-menu a {
        text-align: center;
        padding: 0.3rem;
    }

    #guest-search {
        width: 100%;
        box-sizing: border-box;
    }

    .main-content {
        width: 100%;
        min-width: 0;
        overflow: visible;
        overflow-wrap: break-word;
        word-wrap: break-word;
        line-height: 1.2;
    }

    .main-content img {
        max-width: 100%;
        height: auto;
    }

    /* Fix pre tag overflow */
    .main-content pre {
        white-space: pre-wrap;
        word-wrap: break-word;
    }

    /* Fix long URLs breaking layout */
    .main-content a {
        word-break: break-all;
    }

    /* Fix details-table label width on mobile */
    .details-table .label {
        width: auto;
    }

    /* Make RSVP form table stack on mobile (but not details-table) */
    .main-content form table,
    .main-content form table tbody {
        display: block;
        width: 100%;
    }

    .main-content form table td {
        display: block;
        width: 100%;
        padding: 0.25rem 0;
    }

    .main-content form table tr {
        display: block;
        margin-bottom: 0.75rem;
    }

    .main-content form table tr.hidden {
        display: none;
    }

    .fancy-header {
        font-size: 1.375rem;
    }
}
