/* styles/main.css */

/* ===== RESET & BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Colors */
    --primary-blue: #007bff;
    --primary-dark: #0056b3;
    --primary-light: #e3f2fd;

    --gray-50: #f8f9fa;
    --gray-100: #e9ecef;
    --gray-200: #dee2e6;
    --gray-300: #ced4da;
    --gray-400: #adb5bd;
    --gray-500: #6c757d;
    --gray-600: #495057;
    --gray-700: #343a40;
    --gray-800: #212529;
    --gray-900: #121416;

    --success: #28a745;
    --warning: #ffc107;
    --danger: #dc3545;
    --info: #17a2b8;

    /* Typography */
    --font-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    --font-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;

    /* Border radius */
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.2);
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    line-height: 1.6;
    color: var(--gray-800);
    background: white;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== TYPOGRAPHY ===== */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: var(--space-md);
    color: var(--gray-900);
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.5rem;
}

h4 {
    font-size: 1.25rem;
}

p {
    margin-bottom: var(--space-md);
    line-height: 1.7;
}

a {
    color: var(--primary-blue);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--primary-dark);
}

/* ===== LAYOUT ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

/* ===== HOMEPAGE SPECIFIC STYLES ===== */

/* Main container */
main {
    min-height: 100vh;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

/* Ad Container */
.ad-container {
    background: white;
    padding: var(--space-3xl) var(--space-xl);
    margin-bottom: var(--space-2xl);
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-lg);
}

.ad-container h1 {
    font-size: 2.75rem;
    text-align: center;
    margin-bottom: var(--space-lg);
    background: linear-gradient(135deg, var(--gray-900), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.ad-container h2 {
    font-size: 1.75rem;
    color: var(--gray-700);
    margin-bottom: var(--space-lg);
}

.ad-container p {
    font-size: 1.125rem;
    line-height: 1.8;
    margin-bottom: var(--space-lg);
    color: var(--gray-600);
}

.ad-container strong {
    color: var(--gray-900);
    font-weight: 600;
}

/* Tools Grid */
.tools-section {
    padding: var(--space-3xl) 0;
    background: white;
}

.tools-section h2 {
    text-align: center;
    margin-bottom: var(--space-2xl);
    font-size: 2.25rem;
}

.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-xl);
    max-width: 1000px;
    margin: 0 auto;
}

.tool-card {
    background: var(--gray-50);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    text-align: center;
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
}

.tool-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary-blue);
    box-shadow: var(--shadow-lg);
}

.tool-card h3 {
    color: var(--gray-900);
    margin-bottom: var(--space-sm);
}

.tool-card p {
    color: var(--gray-600);
    margin-bottom: var(--space-lg);
}

.tool-link {
    display: inline-block;
    padding: var(--space-sm) var(--space-lg);
    background: var(--primary-blue);
    color: white;
    border-radius: var(--radius-md);
    font-weight: 600;
    transition: all 0.2s ease;
}

.tool-link:hover {
    background: var(--primary-dark);
    transform: translateX(2px);
}

/* Blog Carousel */
.blog-section {
    padding: var(--space-3xl) 0;
    background: var(--gray-50);
}

.blog-section h2 {
    text-align: center;
    margin-bottom: var(--space-2xl);
    font-size: 2.25rem;
}

.blog-carousel {
    display: flex;
    gap: var(--space-lg);
    overflow-x: auto;
    padding: var(--space-lg) 0;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--gray-400) transparent;
}

.blog-carousel::-webkit-scrollbar {
    height: 6px;
}

.blog-carousel::-webkit-scrollbar-track {
    background: transparent;
}

.blog-carousel::-webkit-scrollbar-thumb {
    background: var(--gray-400);
    border-radius: 3px;
}

.blog-carousel::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
}

.carousel-item {
    flex: 0 0 320px;
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
}

.carousel-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.carousel-image-container {
    width: 100%;
    height: 180px;
    overflow: hidden;
}

.carousel-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.carousel-item:hover .carousel-image {
    transform: scale(1.05);
}

.carousel-content {
    padding: var(--space-lg);
}

.carousel-title {
    font-size: 1.125rem;
    margin-bottom: var(--space-sm);
    color: var(--gray-900);
    line-height: 1.4;
}

.carousel-excerpt {
    font-size: 0.9rem;
    color: var(--gray-600);
    line-height: 1.5;
    margin-bottom: var(--space-md);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.carousel-link {
    color: var(--primary-blue);
    font-weight: 600;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.carousel-link:hover {
    color: var(--primary-dark);
}

/* ===== UTILITY CLASSES ===== */
.text-center {
    text-align: center;
}

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

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

.mb-0 {
    margin-bottom: 0;
}

.mb-sm {
    margin-bottom: var(--space-sm);
}

.mb-md {
    margin-bottom: var(--space-md);
}

.mb-lg {
    margin-bottom: var(--space-lg);
}

.mb-xl {
    margin-bottom: var(--space-xl);
}

.mt-0 {
    margin-top: 0;
}

.mt-sm {
    margin-top: var(--space-sm);
}

.mt-md {
    margin-top: var(--space-md);
}

.mt-lg {
    margin-top: var(--space-lg);
}

.mt-xl {
    margin-top: var(--space-xl);
}

.p-0 {
    padding: 0;
}

.p-sm {
    padding: var(--space-sm);
}

.p-md {
    padding: var(--space-md);
}

.p-lg {
    padding: var(--space-lg);
}

.p-xl {
    padding: var(--space-xl);
}

/* ===== LOADING & ERROR STATES ===== */
.loading {
    text-align: center;
    padding: var(--space-2xl);
    color: var(--gray-500);
}

.error {
    background: #fff5f5;
    border: 1px solid #fed7d7;
    color: #c53030;
    padding: var(--space-lg);
    border-radius: var(--radius-md);
    text-align: center;
}

.error-state {
    text-align: center;
    padding: var(--space-3xl);
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.error-state h2 {
    color: var(--danger);
    margin-bottom: var(--space-md);
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    :root {
        font-size: 14px;
    }

    .container {
        padding: 0 var(--space-md);
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.75rem;
    }

    .ad-container {
        padding: var(--space-xl) var(--space-lg);
        margin-bottom: var(--space-xl);
    }

    .ad-container h1 {
        font-size: 2rem;
    }

    .tools-section,
    .blog-section {
        padding: var(--space-xl) 0;
    }

    .tool-grid {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }

    .blog-carousel {
        gap: var(--space-md);
    }

    .carousel-item {
        flex: 0 0 280px;
    }
}

@media (max-width: 480px) {
    :root {
        font-size: 13px;
    }

    .ad-container {
        padding: var(--space-lg) var(--space-md);
    }

    .carousel-item {
        flex: 0 0 260px;
    }

    .carousel-image-container {
        height: 160px;
    }
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}

/* Focus styles for keyboard navigation */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --primary-blue: #0000ff;
        --gray-800: #000000;
        --gray-600: #333333;
    }
}

/* Print styles */
@media print {

    .tool-grid,
    .blog-carousel {
        display: none;
    }

    .ad-container {
        box-shadow: none;
        border: 1px solid #000;
    }
}