/* Modern CSS Framework for Lackadaisical Security
   A responsive, clean design system
*/

/* --------------------
   CSS Reset and Base
   ------------------- */
:root {
    /* Core colors */
    --primary-color: #2a3f5f;
    --secondary-color: #e74c3c;
    --accent-color: #f39c12;
    --dark-bg: #1a1a2e;
    --light-bg: #f8f9fa;
    --card-bg: #ffffff;
    
    /* Text colors */
    --light-text: #ffffff;
    --dark-text: #333333;
    --medium-text: #6c757d;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #2a3f5f 0%, #1a1a2e 100%);
    --gradient-accent: linear-gradient(135deg, #e74c3c 0%, #f39c12 100%);
    
    /* UI elements */
    --border-radius-sm: 4px;
    --border-radius: 8px;
    --border-radius-lg: 16px;
    --border-radius-xl: 24px;
    --border-radius-pill: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
    --shadow-inner: inset 0 2px 4px rgba(0, 0, 0, 0.05);
    
    /* Animations */
    --transition: all 0.3s ease;
    
    /* Patterns */
    --pattern-overlay: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%233a5f8f' fill-opacity='0.05' fill-rule='evenodd'%3E%3Ccircle cx='3' cy='3' r='3'/%3E%3Ccircle cx='13' cy='13' r='3'/%3E%3C/g%3E%3C/svg%3E");
    
    /* Typography */
    --font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    
    /* Fluid type scale 
       Using clamp() for fluid typography based on viewport width */
    --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
    --text-sm: clamp(0.875rem, 0.8rem + 0.375vw, 1rem);
    --text-base: clamp(1rem, 0.925rem + 0.375vw, 1.125rem);
    --text-md: clamp(1.125rem, 1rem + 0.625vw, 1.25rem);
    --text-lg: clamp(1.25rem, 1.125rem + 0.625vw, 1.5rem);
    --text-xl: clamp(1.5rem, 1.375rem + 0.625vw, 1.875rem);
    --text-2xl: clamp(1.875rem, 1.75rem + 0.625vw, 2.25rem);
    --text-3xl: clamp(2.25rem, 2rem + 1.25vw, 3rem);
    --text-4xl: clamp(3rem, 2.75rem + 1.25vw, 3.75rem);
    
    /* Spacing 
       Using clamp() for fluid spacing based on viewport width */
    --space-1: clamp(0.25rem, 0.2rem + 0.25vw, 0.5rem);
    --space-2: clamp(0.5rem, 0.4rem + 0.5vw, 0.75rem);
    --space-3: clamp(0.75rem, 0.6rem + 0.75vw, 1rem);
    --space-4: clamp(1rem, 0.8rem + 1vw, 1.5rem);
    --space-5: clamp(1.5rem, 1.2rem + 1.5vw, 2rem);
    --space-6: clamp(2rem, 1.6rem + 2vw, 3rem);
    --space-8: clamp(3rem, 2.4rem + 3vw, 4rem);
    --space-10: clamp(4rem, 3.2rem + 4vw, 6rem);
    --space-12: clamp(6rem, 4.8rem + 6vw, 8rem);
    
    /* Container sizes */
    --container-sm: 640px;
    --container: 1200px;
    --container-lg: 1440px;
    
    /* Z-index layers */
    --z-behind: -1;
    --z-normal: 0;
    --z-above: 1;
    --z-overlay: 10;
    --z-sticky: 100;
    --z-drawer: 200;
    --z-nav: 300;
    --z-modal: 400;
    --z-toast: 500;
}

/* Improved reset for better cross-browser consistency */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    scroll-behavior: smooth;
    height: 100%;
}

body {
    font-family: var(--font-family);
    font-size: var(--text-base);
    color: var(--dark-text);
    background-color: var(--light-bg);
    background-image: var(--pattern-overlay);
    background-attachment: fixed;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
}

main {
    flex: 1 0 auto;
}

img, svg {
    display: block;
    max-width: 100%;
    height: auto;
}

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

button {
    cursor: pointer;
}

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

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

/* --------------------
   Layout Components
   ------------------- */
.container {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: var(--space-4);
}

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

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

/* Modern flexbox-based grid system */
.row {
    display: flex;
    flex-wrap: wrap;
    margin-inline: calc(var(--space-4) * -1);
}

.col {
    flex: 1 0 0%;
    padding-inline: var(--space-4);
    width: 100%;
}

/* Grid columns with responsive breakpoints */
.col-12 { flex: 0 0 auto; width: 100%; }
.col-11 { flex: 0 0 auto; width: 91.66666667%; }
.col-10 { flex: 0 0 auto; width: 83.33333333%; }
.col-9 { flex: 0 0 auto; width: 75%; }
.col-8 { flex: 0 0 auto; width: 66.66666667%; }
.col-7 { flex: 0 0 auto; width: 58.33333333%; }
.col-6 { flex: 0 0 auto; width: 50%; }
.col-5 { flex: 0 0 auto; width: 41.66666667%; }
.col-4 { flex: 0 0 auto; width: 33.33333333%; }
.col-3 { flex: 0 0 auto; width: 25%; }
.col-2 { flex: 0 0 auto; width: 16.66666667%; }
.col-1 { flex: 0 0 auto; width: 8.33333333%; }

/* Tablet breakpoint */
@media (max-width: 992px) {
    .col-md-12 { flex: 0 0 auto; width: 100%; }
    .col-md-11 { flex: 0 0 auto; width: 91.66666667%; }
    .col-md-10 { flex: 0 0 auto; width: 83.33333333%; }
    .col-md-9 { flex: 0 0 auto; width: 75%; }
    .col-md-8 { flex: 0 0 auto; width: 66.66666667%; }
    .col-md-7 { flex: 0 0 auto; width: 58.33333333%; }
    .col-md-6 { flex: 0 0 auto; width: 50%; }
    .col-md-5 { flex: 0 0 auto; width: 41.66666667%; }
    .col-md-4 { flex: 0 0 auto; width: 33.33333333%; }
    .col-md-3 { flex: 0 0 auto; width: 25%; }
    .col-md-2 { flex: 0 0 auto; width: 16.66666667%; }
    .col-md-1 { flex: 0 0 auto; width: 8.33333333%; }
}

/* Mobile breakpoint */
@media (max-width: 768px) {
    .col-sm-12 { flex: 0 0 auto; width: 100%; }
    .col-sm-11 { flex: 0 0 auto; width: 91.66666667%; }
    .col-sm-10 { flex: 0 0 auto; width: 83.33333333%; }
    .col-sm-9 { flex: 0 0 auto; width: 75%; }
    .col-sm-8 { flex: 0 0 auto; width: 66.66666667%; }
    .col-sm-7 { flex: 0 0 auto; width: 58.33333333%; }
    .col-sm-6 { flex: 0 0 auto; width: 50%; }
    .col-sm-5 { flex: 0 0 auto; width: 41.66666667%; }
    .col-sm-4 { flex: 0 0 auto; width: 33.33333333%; }
    .col-sm-3 { flex: 0 0 auto; width: 25%; }
    .col-sm-2 { flex: 0 0 auto; width: 16.66666667%; }
    .col-sm-1 { flex: 0 0 auto; width: 8.33333333%; }
}

/* CSS Grid layout for modern browsers */
.grid {
    display: grid;
    gap: var(--space-4);
    grid-template-columns: repeat(12, 1fr);
}

/* Auto-fit grid for cards and similar items */
.auto-grid {
    display: grid;
    gap: var(--space-4);
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

/* Stack layout with consistent spacing */
.stack {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

/* CSS-only responsive navigation */
#nav-toggle {
    display: none;
}

.navbar {
    background: var(--gradient-primary);
    padding: var(--space-4) 0;
    position: sticky;
    width: 100%;
    top: 0;
    z-index: var(--z-nav);
    box-shadow: var(--shadow);
}

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

.logo {
    display: flex;
    align-items: center;
}

.logo a {
    display: flex;
    align-items: center;
    color: var(--light-text);
    font-weight: 600;
}

.logo h1 {
    font-size: var(--text-xl);
    margin: 0;
}

.logo span {
    color: var(--accent-color);
}

.nav-links {
    display: flex;
    gap: var(--space-5);
    list-style: none;
}

.nav-links a {
    color: var(--light-text);
    font-weight: 500;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent-color);
    transition: var(--transition);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

.cta-btn {
    background: var(--gradient-accent);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--border-radius-pill);
    color: var(--light-text);
    box-shadow: 0 3px 10px rgba(231, 76, 60, 0.3);
    transition: transform 0.3s, box-shadow 0.3s;
}

.cta-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(231, 76, 60, 0.4);
    color: var(--light-text);
}

.nav-toggle-label {
    display: none;
    cursor: pointer;
}

@media (max-width: 992px) {
    .nav-toggle-label {
        display: block;
        z-index: var(--z-above);
    }
    
    .nav-toggle-label span {
        display: block;
        width: 25px;
        height: 3px;
        background-color: var(--light-text);
        margin: 5px 0;
        transition: var(--transition);
    }
    
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        height: 100vh;
        width: 100%;
        background-color: var(--dark-bg);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        transition: right 0.3s ease;
    }
    
    #nav-toggle:checked ~ .nav-links {
        right: 0;
    }
    
    #nav-toggle:checked ~ .nav-toggle-label span:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    
    #nav-toggle:checked ~ .nav-toggle-label span:nth-child(2) {
        opacity: 0;
    }
    
    #nav-toggle:checked ~ .nav-toggle-label span:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
}

/* --------------------
   Typography
   ------------------- */
h1, h2, h3, h4, h5, h6 {
    line-height: 1.2;
    font-weight: 700;
    margin-bottom: var(--space-4);
    color: var(--primary-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-md); }

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

.lead {
    font-size: var(--text-lg);
    margin-bottom: var(--space-6);
    color: var(--medium-text);
}

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* --------------------
   UI Components
   ------------------- */

/* Button styles */
.btn {
    display: inline-block;
    padding: var(--space-3) var(--space-5);
    border-radius: var(--border-radius);
    font-weight: 600;
    text-align: center;
    transition: var(--transition);
    border: none;
    outline: none;
    cursor: pointer;
}

.btn-primary {
    background: var(--gradient-accent);
    color: var(--light-text);
    box-shadow: 0 4px 10px rgba(231, 76, 60, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(231, 76, 60, 0.4);
    color: var(--light-text);
}

.btn-secondary {
    background: transparent;
    color: var(--light-text);
    border: 2px solid var(--light-text);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.btn-dark {
    background: var(--dark-bg);
    color: var(--light-text);
}

.btn-light {
    background: var(--light-bg);
    color: var(--dark-text);
}

.btn-link {
    background: transparent;
    padding: var(--space-2) 0;
    color: var(--primary-color);
    text-decoration: underline;
    border-radius: 0;
}

.btn-sm {
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-sm);
}

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

.btn-icon {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}

/* Card Component */
.card {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

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

.card-header {
    padding: var(--space-4);
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.card-body {
    padding: var(--space-4);
}

.card-footer {
    padding: var(--space-4);
    border-top: 1px solid rgba(0,0,0,0.05);
}

.card-img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

/* Blog/Article Cards */
.blog-card {
    position: relative;
    transition: var(--transition);
}

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

.blog-card-img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.blog-card-category {
    position: absolute;
    top: var(--space-4);
    left: var(--space-4);
    background: var(--gradient-accent);
    color: var(--light-text);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--border-radius-pill);
    font-size: var(--text-xs);
    font-weight: 600;
}

.blog-card-content {
    padding: var(--space-4);
}

.blog-card-meta {
    color: var(--medium-text);
    font-size: var(--text-sm);
    margin-bottom: var(--space-2);
}

.blog-card-title {
    margin-bottom: var(--space-3);
}

/* Hero sections */
.hero {
    background: var(--gradient-primary);
    color: var(--light-text);
    padding: calc(var(--space-10) + 60px) 0 var(--space-10);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.3;
    z-index: 0;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.hero-title {
    font-size: var(--text-4xl);
    margin-bottom: var(--space-4);
    color: var(--light-text);
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.hero-title span {
    color: var(--accent-color);
    position: relative;
    display: inline-block;
}

.hero-title span::after {
    content: '';
    position: absolute;
    bottom: 8px;
    left: 0;
    width: 100%;
    height: 8px;
    background-color: rgba(243, 156, 18, 0.3);
    z-index: -1;
    transform: skew(-12deg);
}

.hero-description {
    font-size: var(--text-lg);
    margin-bottom: var(--space-6);
}

.hero-buttons {
    display: flex;
    gap: var(--space-4);
    justify-content: center;
}

@media (max-width: 768px) {
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .hero-title {
        font-size: var(--text-3xl);
    }
}

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

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

.form-control {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: var(--border-radius);
    font-size: var(--text-base);
    transition: border 0.2s, box-shadow 0.2s;
    background-color: var(--light-bg);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(42, 63, 95, 0.1);
    outline: none;
}

.form-row {
    display: flex;
    gap: var(--space-4);
    margin-bottom: var(--space-4);
}

@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
    }
}

/* Footer */
.footer {
    background: var(--gradient-primary);
    color: var(--light-text);
    padding: var(--space-10) 0 var(--space-4);
    position: relative;
    overflow: hidden;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: var(--pattern-overlay);
    opacity: 0.05;
}

.footer-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-6);
    margin-bottom: var(--space-6);
}

.footer-logo {
    flex: 1 1 300px;
}

.footer-logo h2 {
    font-size: var(--text-2xl);
    margin-bottom: var(--space-3);
    color: var(--light-text);
}

.footer-logo span {
    color: var(--accent-color);
}

.footer-links {
    flex: 2 1 600px;
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: var(--space-6);
}

.footer-column h3 {
    color: var(--light-text);
    margin-bottom: var(--space-4);
    font-size: var(--text-lg);
    position: relative;
    padding-bottom: var(--space-2);
}

.footer-column h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background-color: var(--accent-color);
    border-radius: 2px;
}

.footer-column ul {
    list-style: none;
}

.footer-column li {
    margin-bottom: var(--space-3);
}

.footer-column a {
    color: var(--medium-text);
    transition: var(--transition);
}

.footer-column a:hover {
    color: var(--accent-color);
    padding-left: var(--space-3);
}

.footer-bottom {
    text-align: center;
    padding-top: var(--space-4);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: var(--text-sm);
    color: var(--medium-text);
    position: relative;
    z-index: 1;
}

/* Utility Classes */
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-5 { margin-top: var(--space-5); }
.mt-6 { margin-top: var(--space-6); }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-5 { margin-bottom: var(--space-5); }
.mb-6 { margin-bottom: var(--space-6); }

.py-0 { padding-top: 0; padding-bottom: 0; }
.py-1 { padding-top: var(--space-1); padding-bottom: var(--space-1); }
.py-2 { padding-top: var(--space-2); padding-bottom: var(--space-2); }
.py-3 { padding-top: var(--space-3); padding-bottom: var(--space-3); }
.py-4 { padding-top: var(--space-4); padding-bottom: var(--space-4); }
.py-5 { padding-top: var(--space-5); padding-bottom: var(--space-5); }
.py-6 { padding-top: var(--space-6); padding-bottom: var(--space-6); }

.px-0 { padding-left: 0; padding-right: 0; }
.px-1 { padding-left: var(--space-1); padding-right: var(--space-1); }
.px-2 { padding-left: var(--space-2); padding-right: var(--space-2); }
.px-3 { padding-left: var(--space-3); padding-right: var(--space-3); }
.px-4 { padding-left: var(--space-4); padding-right: var(--space-4); }
.px-5 { padding-left: var(--space-5); padding-right: var(--space-5); }
.px-6 { padding-left: var(--space-6); padding-right: var(--space-6); }

.w-100 { width: 100%; }
.h-100 { height: 100%; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.items-center { align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }

.hidden { display: none; }

@media (min-width: 769px) {
    .md\:hidden { display: none; }
    .md\:flex { display: flex; }
    .md\:block { display: block; }
}

@media (min-width: 993px) {
    .lg\:hidden { display: none; }
    .lg\:flex { display: flex; }
    .lg\:block { display: block; }
}

/* Accessibility */
:focus {
    outline: 3px solid rgba(231, 76, 60, 0.5);
    outline-offset: 2px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Skip to main content for keyboard users */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: white;
    padding: 8px;
    z-index: 100;
}

.skip-link:focus {
    top: 0;
}

/* Animation utilities */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade {
    animation: fadeIn 0.6s ease forwards;
}

.animate-delay-1 { animation-delay: 0.1s; }
.animate-delay-2 { animation-delay: 0.2s; }
.animate-delay-3 { animation-delay: 0.3s; }
.animate-delay-4 { animation-delay: 0.4s; }
