/* ==========================================================================
   Blessed Bits - Global Stylesheet
   Consolidated CSS for consistent styling across all pages
   ========================================================================== */

/* ==========================================================================
   1. CSS Variables - Design Tokens
   ========================================================================== */
:root {
    /* Primary Colors */
    --primary-color: #1a365d;
    --primary-dark: #0f172a;
    --primary-hover: #2c5282;
    
    /* Secondary/Accent Colors */
    --secondary-color: #3b82f6;
    --secondary-hover: #2563eb;
    --accent-color: #e53e3e;
    --accent-hover: #c53030;
    --gold-accent: #F5B921;
    --gold-hover: #e0a800;
    
    /* Status Colors */
    --success-color: #10b981;
    --success-dark: #059669;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    
    /* Neutral Colors */
    --text-color: #1e293b;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    
    /* Background Colors */
    --bg-color: #ffffff;
    --bg-light: #f8fafc;
    --bg-gray: #f1f5f9;
    
    /* Border Colors */
    --border-color: #e2e8f0;
    --border-light: #e5e7eb;
    
    /* 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);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1);
    
    /* Spacing Scale */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    
    /* Border Radius */
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-full: 9999px;
    
    /* Typography */
    --font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-family-display: 'Inter', var(--font-family);
    
    /* Font Sizes */
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 2rem;
    --text-4xl: 2.5rem;
    --text-5xl: 3rem;
    
    /* Line Heights */
    --leading-tight: 1.25;
    --leading-normal: 1.5;
    --leading-relaxed: 1.625;
    --leading-loose: 1.75;
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    /* Container Widths */
    --container-sm: 640px;
    --container-md: 768px;
    --container-lg: 1024px;
    --container-xl: 1200px;
}

/* ==========================================================================
   2. CSS Reset & Base Styles
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
}

* {
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    font-size: var(--text-base);
    line-height: var(--leading-relaxed);
    color: var(--text-color);
    background-color: var(--bg-color);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img, picture, video, canvas, svg {
    display: block;
    max-width: 100%;
}

input, button, textarea, select {
    font: inherit;
}

a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

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

/* ==========================================================================
   3. Typography
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
    line-height: var(--leading-tight);
    font-weight: 700;
    color: var(--text-color);
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

p {
    margin-bottom: var(--space-4);
}

p:last-child {
    margin-bottom: 0;
}

/* ==========================================================================
   4. Layout Components
   ========================================================================== */

/* Container */
.container {
    max-width: var(--container-xl);
    margin: 0 auto;
    padding: 0 var(--space-8);
}

.container-sm {
    max-width: var(--container-sm);
}

.container-md {
    max-width: var(--container-md);
}

.container-lg {
    max-width: var(--container-lg);
}

/* Section Spacing */
.section {
    padding: var(--space-16) 0;
}

.section-sm {
    padding: var(--space-8) 0;
}

/* ==========================================================================
   5. Hero Section
   ========================================================================== */
.hero {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
    padding: var(--space-16) var(--space-8);
    text-align: center;
}

.hero-dark {
    background: var(--primary-dark);
}

.hero h1 {
    font-size: var(--text-5xl);
    color: white;
    margin-bottom: var(--space-4);
}

.hero p {
    font-size: var(--text-xl);
    opacity: 0.9;
    max-width: 800px;
    margin: 0 auto var(--space-8);
}

@media (max-width: 768px) {
    .hero {
        padding: var(--space-12) var(--space-4);
    }
    
    .hero h1 {
        font-size: var(--text-3xl);
    }
    
    .hero p {
        font-size: var(--text-lg);
    }
}

/* ==========================================================================
   6. Buttons
   ========================================================================== */
.btn {
    display: inline-block;
    padding: var(--space-3) var(--space-6);
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: var(--text-base);
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    border: none;
    transition: all var(--transition-normal);
}

.btn:hover {
    text-decoration: none;
    transform: translateY(-2px);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Button Sizes */
.btn-sm {
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-sm);
}

.btn-lg {
    padding: var(--space-4) var(--space-8);
    font-size: var(--text-lg);
}

/* Button Variants */
.btn-primary {
    background: var(--primary-color);
    color: white;
}

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

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

.btn-secondary:hover {
    background: var(--secondary-hover);
    color: white;
}

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

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

.btn-gold {
    background: var(--gold-accent);
    color: #000;
}

.btn-gold:hover {
    background: var(--gold-hover);
    color: #000;
}

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

.btn-success:hover {
    background: var(--success-dark);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

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

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

.btn-outline-light:hover {
    background: white;
    color: var(--primary-color);
}

/* CTA Button (legacy support) */
.cta-button {
    display: inline-block;
    background: var(--accent-color);
    color: white;
    padding: var(--space-4) var(--space-8);
    border-radius: var(--radius-md);
    text-decoration: none;
    font-weight: 600;
    transition: all var(--transition-normal);
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    color: white;
    text-decoration: none;
}

/* ==========================================================================
   7. Cards
   ========================================================================== */
.card {
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--space-8);
    box-shadow: var(--shadow-md);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.card-flat {
    box-shadow: none;
    border: 1px solid var(--border-color);
}

.card-flat:hover {
    box-shadow: var(--shadow-md);
}

/* Product Card */
.product-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--space-8);
    box-shadow: var(--shadow-md);
    margin-bottom: var(--space-8);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

/* Value Card */
.value-card {
    background: var(--bg-light);
    padding: var(--space-8);
    border-radius: var(--radius-lg);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.value-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.value-card h3 {
    margin: 0 0 var(--space-4) 0;
    color: var(--gold-accent);
    font-size: var(--text-xl);
}

.value-card p {
    font-size: var(--text-base);
    color: var(--text-muted);
    margin: 0;
}

/* ==========================================================================
   8. Forms
   ========================================================================== */
.form-group {
    margin-bottom: var(--space-6);
}

.form-group label {
    display: block;
    margin-bottom: var(--space-2);
    font-weight: 600;
    color: var(--primary-color);
}

.form-control {
    width: 100%;
    padding: var(--space-3);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: var(--text-base);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    background: white;
}

.form-control:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

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

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

select.form-control {
    cursor: pointer;
}

/* Form Messages */
.form-message {
    padding: var(--space-4);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-4);
    font-size: var(--text-sm);
}

.form-message-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid var(--success-color);
}

.form-message-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid var(--error-color);
}

/* Submit Button */
.submit-btn {
    width: 100%;
    background: var(--accent-color);
    color: white;
    padding: var(--space-4) var(--space-8);
    border: none;
    border-radius: var(--radius-md);
    font-size: var(--text-lg);
    font-weight: 600;
    cursor: pointer;
    transition: background-color var(--transition-normal);
}

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

.submit-btn:disabled {
    background: var(--text-light);
    cursor: not-allowed;
}

/* ==========================================================================
   9. Grids
   ========================================================================== */
.grid {
    display: grid;
    gap: var(--space-8);
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

.grid-auto {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-8);
    padding: var(--space-8);
}

.values-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-8);
}

@media (max-width: 768px) {
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .values-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   10. Feature Section
   ========================================================================== */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-8);
    padding: var(--space-8);
    background: var(--bg-light);
}

.feature {
    text-align: center;
    padding: var(--space-8);
}

.feature h2, .feature h3 {
    margin-bottom: var(--space-4);
}

.feature p {
    color: var(--text-muted);
}

/* Feature List */
.feature-list {
    list-style: none;
    padding: 0;
    margin: var(--space-4) 0;
}

.feature-list li {
    margin-bottom: var(--space-2);
    padding-left: var(--space-6);
    position: relative;
}

.feature-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--success-color);
    font-weight: bold;
}

/* ==========================================================================
   11. Footer
   ========================================================================== */
.site-footer {
    background: var(--primary-color);
    color: white;
    padding: var(--space-8);
    text-align: center;
}

.site-footer a {
    color: white;
    text-decoration: none;
}

.site-footer a:hover {
    text-decoration: underline;
    color: white;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-4);
    max-width: var(--container-xl);
    margin: 0 auto;
}

.footer-links {
    display: flex;
    gap: var(--space-6);
    align-items: center;
}

.footer-links a {
    font-weight: 500;
}

@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-links {
        justify-content: center;
    }
}

/* Legacy footer support */
footer {
    background: var(--primary-color);
    color: white;
    padding: var(--space-8);
    text-align: center;
}

footer a {
    color: white;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   12. Messages & Alerts
   ========================================================================== */
.message, .alert {
    padding: var(--space-4);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-4);
}

.message-success, .alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid var(--success-color);
}

.message-error, .alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid var(--error-color);
}

.message-warning, .alert-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid var(--warning-color);
}

.message-info, .alert-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid var(--secondary-color);
}

/* ==========================================================================
   13. Utility Classes
   ========================================================================== */

/* Text Alignment */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* Font Weight */
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

/* Text Colors */
.text-primary { color: var(--primary-color); }
.text-secondary { color: var(--secondary-color); }
.text-accent { color: var(--accent-color); }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success-color); }
.text-warning { color: var(--warning-color); }
.text-error { color: var(--error-color); }
.text-white { color: white; }

/* Background Colors */
.bg-light { background-color: var(--bg-light); }
.bg-gray { background-color: var(--bg-gray); }
.bg-primary { background-color: var(--primary-color); }
.bg-white { background-color: white; }

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

/* Flex Utilities */
.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.flex-wrap { flex-wrap: wrap; }
.gap-2 { gap: var(--space-2); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

/* Margin Utilities */
.mt-0 { margin-top: 0; }
.mt-4 { margin-top: var(--space-4); }
.mt-8 { margin-top: var(--space-8); }
.mb-0 { margin-bottom: 0; }
.mb-4 { margin-bottom: var(--space-4); }
.mb-8 { margin-bottom: var(--space-8); }
.mx-auto { margin-left: auto; margin-right: auto; }

/* Padding Utilities */
.p-4 { padding: var(--space-4); }
.p-8 { padding: var(--space-8); }
.py-4 { padding-top: var(--space-4); padding-bottom: var(--space-4); }
.py-8 { padding-top: var(--space-8); padding-bottom: var(--space-8); }
.px-4 { padding-left: var(--space-4); padding-right: var(--space-4); }
.px-8 { padding-left: var(--space-8); padding-right: var(--space-8); }

/* Border Utilities */
.rounded { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-full { border-radius: var(--radius-full); }

/* Shadow Utilities */
.shadow { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-none { box-shadow: none; }

/* Width Utilities */
.w-full { width: 100%; }
.max-w-sm { max-width: var(--container-sm); }
.max-w-md { max-width: var(--container-md); }
.max-w-lg { max-width: var(--container-lg); }

/* ==========================================================================
   14. Responsive Helpers
   ========================================================================== */
@media (max-width: 768px) {
    .hide-mobile { display: none !important; }
    
    h1 { font-size: var(--text-3xl); }
    h2 { font-size: var(--text-2xl); }
    h3 { font-size: var(--text-xl); }
    
    .container {
        padding: 0 var(--space-4);
    }
}

@media (min-width: 769px) {
    .hide-desktop { display: none !important; }
}

/* ==========================================================================
   15. Animation & Loading
   ========================================================================== */
.loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Fade In */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

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

/* ==========================================================================
   16. Back Link
   ========================================================================== */
.back-link {
    text-align: center;
    margin-top: var(--space-8);
}

.back-link a {
    color: var(--secondary-color);
    text-decoration: none;
    font-size: var(--text-sm);
}

.back-link a:hover {
    text-decoration: underline;
}
