/* Main Campification CSS - Organized Structure */

/* Import CSS variables and base styles first */
@import url('./variables.css');

/* Import component styles */
@import url('./components/navigation.css');
@import url('./components/footer.css');
@import url('./components/forms.css');

/* Import shared utilities */
@import url('./shared/utilities.css');

/* Import page-specific styles */
@import url('./pages/home.css');
@import url('./pages/campgrounds.css');

/* Global base styles */
* {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    height: 100%;
    min-height: 100%;
}

body {
    font-family: var(--font-primary);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-light);
    line-height: var(--line-height-base);
    color: var(--text-color);
    background-color: var(--background-primary);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    height: 100%;
    min-height: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography base styles */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-primary);
    font-weight: var(--font-weight-medium);
    line-height: var(--line-height-heading);
    color: var(--text-color);
    margin-top: 0;
    margin-bottom: var(--spacing-md);
}

h1 { font-size: var(--font-size-h1); }
h2 { font-size: var(--font-size-h2); }
h3 { font-size: var(--font-size-h3); }
h4 { font-size: var(--font-size-h4); }
h5 { font-size: var(--font-size-h5); }
h6 { font-size: var(--font-size-h6); }

p {
    margin-top: 0;
    margin-bottom: var(--spacing-md);
    line-height: var(--line-height-base);
}

/* Typography classes to match B12 design system */
.display-xl-font { 
    font-family: var(--font-primary);
    font-style: normal;
    font-weight: var(--font-weight-light);
    text-transform: none;
    font-size: 1.75rem;
    line-height: 1;
    letter-spacing: 0px; 
}

.display-lg-font { 
    font-family: var(--font-primary);
    font-style: normal;
    font-weight: var(--font-weight-light);
    text-transform: none;
    font-size: 1.75rem;
    line-height: 1.25;
    letter-spacing: 0px; 
}

.display-md-font { 
    font-family: var(--font-primary);
    font-style: normal;
    font-weight: var(--font-weight-light);
    text-transform: none;
    font-size: 1.125rem;
    line-height: 1.25;
    letter-spacing: 0px; 
}

.display-sm-font { 
    font-family: var(--font-primary);
    font-style: normal;
    font-weight: var(--font-weight-light);
    text-transform: none;
    font-size: 1rem;
    line-height: 1.25;
    letter-spacing: 0px; 
}

.body-font { 
    font-family: var(--font-primary);
    font-style: normal;
    font-weight: var(--font-weight-light);
    text-transform: none;
    font-size: 1rem;
    line-height: 1.5;
    letter-spacing: 0px; 
}

.body-sm-font { 
    font-family: var(--font-primary);
    font-style: normal;
    font-weight: var(--font-weight-light);
    text-transform: none;
    font-size: 1rem;
    line-height: 1.5;
    letter-spacing: 0px; 
}

/* Link styles */
a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition-base);
}

a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

a:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* List styles */
ul, ol {
    margin-top: 0;
    margin-bottom: var(--spacing-md);
    padding-left: var(--spacing-lg);
}

li {
    margin-bottom: var(--spacing-xs);
}

/* Image styles */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Table styles */
table {
    width: 100%;
    margin-bottom: var(--spacing-md);
    border-collapse: collapse;
}

th, td {
    padding: var(--spacing-sm);
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    font-weight: var(--font-weight-medium);
    color: var(--text-color);
    background-color: var(--background-secondary);
}

/* Code styles */
code {
    padding: 0.125rem 0.25rem;
    font-size: 0.875em;
    color: var(--error-color);
    background-color: var(--background-secondary);
    border-radius: var(--border-radius-sm);
}

pre {
    display: block;
    margin-top: 0;
    margin-bottom: var(--spacing-md);
    overflow: auto;
    font-size: 0.875rem;
    background-color: var(--background-secondary);
    padding: var(--spacing-md);
    border-radius: var(--border-radius-md);
}

pre code {
    padding: 0;
    background-color: transparent;
    color: inherit;
}

/* Horizontal rule */
hr {
    margin-top: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
    border: 0;
    border-top: 1px solid var(--border-color);
}

/* Selection styles */
::selection {
    background-color: var(--primary-color);
    color: white;
}

::-moz-selection {
    background-color: var(--primary-color);
    color: white;
}

/* Scrollbar styles */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--background-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: var(--border-radius-sm);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Skip to main content */
.skip-to-main-content {
    position: fixed;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-color);
    color: white;
    padding: var(--spacing-sm) var(--spacing-md);
    z-index: var(--z-modal);
    text-decoration: none;
    border-radius: 0 0 var(--border-radius-md) var(--border-radius-md);
    transition: top 0.3s;
}

.skip-to-main-content:focus {
    top: 0;
    outline: 2px solid white;
    outline-offset: 2px;
    color: white;
    text-decoration: none;
}

/* Page layout */
.sb-page {
    border: none;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main#main-content {
    flex: 1 0 auto;
}

footer.footer, footer.sb-footer {
    flex-shrink: 0;
}

/* Button Styles */
.btn {
    display: inline-block;
    padding: var(--spacing-sm) var(--spacing-lg);
    font-family: var(--font-primary);
    font-weight: var(--font-weight-medium);
    font-size: var(--font-size-base);
    line-height: 1.5;
    text-align: center;
    text-decoration: none;
    vertical-align: middle;
    cursor: pointer;
    border: 1px solid transparent;
    border-radius: var(--border-radius-md);
    transition: var(--transition-base);
    user-select: none;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

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

.btn-primary:hover,
.btn-primary:focus {
    color: white;
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-2px);
    text-decoration: none;
}

.btn-outline-light {
    color: white;
    background-color: transparent;
    border-color: white;
}

.btn-outline-light:hover,
.btn-outline-light:focus {
    color: #121414;
    background-color: white;
    border-color: white;
    transform: translateY(-2px);
    text-decoration: none;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 1s ease forwards;
}

/* Back to top button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-base);
    z-index: var(--z-back-to-top);
    box-shadow: var(--shadow-base);
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover, 
.back-to-top:focus {
    background-color: var(--primary-hover);
    color: white;
    text-decoration: none;
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.back-to-top svg {
    width: 20px;
    height: 20px;
}

/* Dark theme overrides for Bootstrap components */
.form-control, .form-select {
    background-color: var(--background-surface);
    border-color: var(--border-color);
    color: var(--text-color);
}

.form-control:focus, .form-select:focus {
    background-color: var(--background-light);
    border-color: var(--primary-color);
    color: var(--text-color);
    box-shadow: 0 0 0 0.2rem rgba(32, 82, 149, 0.25);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-control:disabled {
    background-color: var(--background-dark);
    color: var(--text-muted);
}

.alert-info {
    background-color: #d1ecf1;
    border-color: #bee5eb;
    color: #0c5460;
}

.alert-success {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.alert-danger {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.card {
    background-color: #ffffff;
    border-color: #e0e0e0;
    color: #333;
}

.modal-content {
    background-color: var(--background-secondary);
    color: var(--text-color);
    border-color: var(--border-color);
}

.modal-header {
    border-bottom-color: var(--border-color);
}

.dropdown-menu {
    background-color: var(--background-surface);
    border-color: var(--border-color);
}

.dropdown-item {
    color: var(--text-color);
}

.dropdown-item:hover, .dropdown-item:focus {
    background-color: var(--background-light);
    color: var(--text-color);
}

.dropdown-divider {
    border-top-color: var(--border-color);
}

/* Print styles */
@media print {
    * {
        background: transparent !important;
        color: black !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
    
    a, a:visited {
        text-decoration: underline;
    }
    
    a[href]:after {
        content: " (" attr(href) ")";
    }
    
    abbr[title]:after {
        content: " (" attr(title) ")";
    }
    
    .navbar, .footer, .back-to-top, .sb-navigation, .sb-footer {
        display: none;
    }
    
    body {
        font-size: 12pt;
    }
    
    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
    }
    
    p {
        orphans: 3;
        widows: 3;
    }
}
