/* ==========================================================================
   CORE.CSS - Consolidated base styles
   Contains: reset, variables, layout, effects, navigation, buttons, cards
   ========================================================================== */

/* ==========================================================================
   RESET
   ========================================================================== */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
}

body {
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

ul, ol {
    list-style: none;
}

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

button {
    border: none;
    background: none;
    font: inherit;
    cursor: pointer;
}

input, textarea, select {
    font: inherit;
}

/* ==========================================================================
   VARIABLES
   ========================================================================== */

:root {
    /* Color palette */
    --deep-water: #132839;
    --ship-brown: #63400f;
    --accent-brown: #724a18;
    --sail-beige: #cdb19f;
    --sail-beige-light: #dcc2af;
    
    /* Metallic colors */
    --metallic-dark: #999;
    --metallic-light: #fff;
    --metallic-mid: #ccc;
    
    /* Site accent colors */
    --accent-gold: #ffcc33;
    --accent-teal: #4ecca3;
    --accent-dark: rgba(30, 30, 30, 0.8);
    
    /* Text colors */
    --text-primary: var(--ship-brown);
    --text-light: var(--sail-beige);
    --text-muted: rgba(99, 64, 15, 0.7);
    
    /* UI element colors */
    --card-bg: var(--sail-beige);
    --card-border: var(--ship-brown);
    --button-bg: var(--ship-brown);
    --button-text: var(--sail-beige);
    --button-hover: var(--accent-brown);
    --input-bg: var(--sail-beige-light);
    --input-border: var(--ship-brown);
    
    /* Layout variables */
    --container-width: 768px;
    --nav-height: 60px;
    --footer-height: 120px;
    
    /* Typography */
    --system-fonts: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, 
        "Helvetica Neue", Arial, sans-serif;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-bold: 600;
    --font-weight-extra-bold: 700;
    
    /* Font sizes */
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-md: 1.125rem;
    --font-size-lg: 1.25rem;
    --font-size-xl: 1.5rem;
    --font-size-2xl: 1.875rem;
    --font-size-3xl: 2.25rem;
    
    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.5rem;
    --space-6: 2rem;
    --space-8: 3rem;
    --space-10: 4rem;
    
    /* Borders */
    --border-radius-sm: 4px;
    --border-radius-md: 6px;
    --border-radius-lg: 8px;
    --border-width-thin: 1px;
    --border-width-thick: 2px;
    --border-width-card: 6px;
    
    /* Shadows */
    --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);
    
    /* Transitions */
    --transition-fast: 150ms;
    --transition-normal: 250ms;
    --transition-slow: 350ms;
    
    /* Z-index scale */
    --z-index-dropdown: 1000;
    --z-index-sticky: 1100;
    --z-index-fixed: 1200;
    --z-index-modal: 1300;
    --z-index-popover: 1400;
    --z-index-tooltip: 1500;
}

/* ==========================================================================
   LAYOUT
   ========================================================================== */

body {
    background-color: var(--deep-water);
    font-family: var(--system-fonts);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

.container {
    width: min(90%, 768px);
    margin: 0 auto;
    padding: 1rem;
}

.d-none-mobile {
    display: block;
}

@media (max-width: 480px) {
    .container {
        width: min(98%, 768px);
        padding: 0.3rem;
    }
    
    .d-none-mobile {
        display: none !important;
    }
}

/* ==========================================================================
   EFFECTS
   ========================================================================== */

.metallic-text {
    background-image: linear-gradient(
      45deg,
      #999 5%,
      #fff 10%,
      #ccc 30%,
      #ddd 50%,
      #ccc 70%,
      #fff 80%,
      #999 95%
    );
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 600;
    white-space: nowrap;
}

.silver-underline {
    text-decoration: underline;
    text-decoration-color: silver;
}

.sail-text {
    color: var(--sail-beige);
    font-weight: 500;
}

h1, h2, h3 {
    color: var(--sail-beige);
    font-weight: 600;
}

h1 {
    font-size: 2.2rem;
    margin-bottom: 1.5rem;
}

h2 {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
}

h3 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
}

/* ==========================================================================
   NAVIGATION
   ========================================================================== */

.navbar {
    background-color: var(--ship-brown);
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    color: var(--sail-beige);
    font-size: 1.2rem;
    text-decoration: none;
}

.nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

.nav-link {
    color: var(--sail-beige);
    text-decoration: none;
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
}

.nav-link:hover {
    background-color: var(--accent-brown);
    border-radius: 4px;
}

.nav-cta {
    border-radius: 4px;
    font-weight: bold;
}

.nav-cta .metallic-text {
    font-size: 1.2rem;
}

.footer {
    text-align: center;
    color: var(--sail-beige);
    opacity: 0.7;
    margin-top: 0rem;
    padding: 1rem;
}

@media (max-width: 480px) {
    .footer {
        font-size: 0.85rem;
    }
}

.footer-nav-link {
    color: var(--sail-beige);
    text-decoration: none;
    font-size: 1.4rem;
    gap: 3rem;
    display:inline-block;
    margin-top: 5rem;
    margin-bottom: 10rem;
    text-decoration: underline;
}

.dashboard-return-link {
    color: var(--sail-beige);
    text-decoration: underline;
    font-size: 1.4rem;
    display: block;
    text-align: center;
    margin-top: 10rem;
    margin-bottom: 5rem;
    opacity: 0.7;
}

.footer-util-link {
    color: var(--sail-beige);
    text-decoration: underline;
    margin: 0.5rem;
    display: inline-block;
}

.footer-util-link:visited {
    color: var(--sail-beige);
}

@media (max-width: 768px) {
    .nav-content {
        justify-content: center;
        text-align: center;
    }
    
    .nav-links {
        gap: 0.25rem;
    }
    
    .nav-link {
        padding: 0.3rem 0.5rem;
        font-size: 0.9rem;
    }
}

.auth-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0rem;
    margin-top: 1rem;
    margin-bottom: 1rem;
}

.auth-button {
    font-size: 1.2rem;
    padding: 0.75rem 1.5rem;
}

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

.btn {
    background-color: var(--ship-brown);
    color: var(--sail-beige);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.5rem;
    white-space: nowrap;
    padding: 0.5rem 1.25rem;
    font-size: 1rem;
    transition: background-color 0.2s, transform 0.1s;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn:hover {
    background-color: var(--accent-brown);
}

.btn:active {
    opacity: 0.9;
}

.btn--small {
    min-height: 2rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    min-width: 5rem;
}

.btn--standard {
    min-height: 2.5rem;
    font-size: 1rem;
    min-width: 8rem;
}

.btn--new-story {
    min-width: 16rem;
    height: 3rem;
    font-size: 1.2rem;
    padding: 0.75rem 1rem;
    position: absolute;
    right: 1rem;
    bottom: 1.5rem;
}

.btn--continue {
    min-width: 8rem;
    max-width: 12rem;
    height: 2.8rem;
    font-size: 1rem;
    padding: 0.7rem 1rem;
    display: inline-block;
}

.btn--choice {
    min-width: 16rem;
    height: 3rem;
    font-size: 1.3rem;
    padding: 0.5rem 2rem;
}

@media (max-width: 480px) {
    .btn--choice {
        min-width: auto;
        width: 90%;
        margin: 0 auto;
    }
}

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

.btn.loading .loading-spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: var(--sail-beige);
    animation: spin 1s ease-in-out infinite;
    margin-left: 0.5em;
}

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

.form-options {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.checkbox-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--ship-brown);
    font-size: 0.9rem;
    padding: 8px 0;
}

.checkbox-container input[type="checkbox"] {
    background: #C0C0C0;
    border: 2px solid transparent;
    box-shadow:
        0 0 0 1px rgba(99, 64, 15, 0.4),
        0 0 0 2px #C0C0C0,
        0 0 2px #C0C0C0,
        inset 0 2px 4px rgba(255,255,255,0.3);
    appearance: none;
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    min-width: 16px;
    min-height: 16px;
    border-radius: 2px;
}

.checkbox-container input[type="checkbox"]:checked {
    background-color: #D3D3D3;
    border: 6px solid var(--accent-brown);
}

.checkbox-container input[type="checkbox"]:hover {
    box-shadow:
        0 0 0 2px #D3D3D3,
        0 0 6px #C0C0C0,
        inset 0 2px 4px rgba(255,255,255,0.4);
}

.checkbox-container input[type="checkbox"]:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.checkbox-container input[type="checkbox"]:disabled + span {
    opacity: 0.5;
}

/* ==========================================================================
   CARDS
   ========================================================================== */

.story-card {
    background-color: var(--sail-beige);
    border: 6px solid var(--ship-brown);
    margin-bottom: 1.5rem;
    border-radius: 6px;
    position: relative;
    overflow: visible;
}

@media (max-width: 480px) {
    .story-card {
        border-width: 4px;
        margin-bottom: 1rem;
    }
    
    .card-content {
        padding: 0.5rem 0.3rem;
    }
}

.story-content, .card-content {
    padding: 1rem;
    color: var(--ship-brown);
    text-align: justify;
    font-weight: 500;
    font-size: 1.1rem;
}

@media (max-width: 480px) {
    .story-content, .card-content {
        padding: 0.8rem 0.5rem;
        font-size: 0.95rem;
    }
}

.story-content p, .card-content p {
    margin-bottom: 1rem;
}

.section-header {
    color: var(--sail-beige);
    font-size: 1.8rem;
    font-weight: 600;
    margin: 1.5rem 0;
}

.story-card h1 {
    color: var(--ship-brown);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.story-card h2 {
    color: var(--ship-brown);
    font-size: 1.6rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.story-card h3 {
    color: var(--ship-brown);
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

@media (max-width: 480px) {
    .story-card h1 {
        font-size: 1.6rem;
        margin-bottom: 0.75rem;
    }
    
    .story-card h2 {
        font-size: 1.4rem;
        margin-bottom: 0.5rem;
    }
    
    .story-card h3 {
        font-size: 1.2rem;
        margin-bottom: 0.4rem;
    }
    
    .story-content, .card-content {
        font-size: 0.95rem;
    }
}

.demo-stories-section {
    margin-top: 2rem;
    text-align: center;
    background-color: var(--sail-beige);
    border: 6px solid var(--ship-brown);
    border-radius: 6px;
}

.demo-stories-section h2 {
    color: var(--ship-brown);
    font-size: 1.8rem;
}

.btn--demo {
    margin: 1rem 0;
    background-color: var(--ship-brown);
    padding: 0.75rem 1.5rem;
    display: inline-flex;
}
