/**
 * Daily Fact Drop - Main Stylesheet
 * Responsive design for all devices
 */

/* CSS Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8fafc;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
.header {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar {
    padding: 1rem 0;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: #3b82f6;
    text-decoration: none;
    transition: color 0.3s ease;
}

.brand-link:hover {
    color: #2563eb;
}

.brand-icon {
    width: 32px;
    height: 32px;
}

.nav-menu {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    color: #64748b;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    padding: 0.5rem 0;
}

.nav-link:hover {
    color: #3b82f6;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background: #64748b;
    margin: 2px 0;
    transition: 0.3s;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 2rem 0;
}

/* Homepage Styles */
.hero-section {
    text-align: center;
    padding: 3rem 0;
    margin-bottom: 3rem;
}

.hero-section h1 {
    font-size: 3rem;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: #3b82f6;
    font-weight: 600;
    margin-bottom: 1rem;
}

.hero-description {
    font-size: 1.125rem;
    color: #64748b;
    max-width: 600px;
    margin: 0 auto;
}

.tools-grid {
    margin-bottom: 3rem;
}

.tools-grid h2 {
    font-size: 2rem;
    color: #1e293b;
    margin-bottom: 2rem;
    text-align: center;
}

.tools-grid > div:not(h2) {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.tool-card {
    background: #fff;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    border: 1px solid #e2e8f0;
}

.tool-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.tool-card.coming-soon {
    opacity: 0.6;
    pointer-events: none;
}

.tool-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.tool-icon {
    width: 48px;
    height: 48px;
    color: #3b82f6;
    margin-bottom: 1rem;
}

.tool-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.tool-card p {
    color: #64748b;
    line-height: 1.6;
}

/* Tool Page Styles */
.breadcrumb {
    margin-bottom: 2rem;
    font-size: 0.875rem;
    color: #64748b;
}

.breadcrumb a {
    color: #3b82f6;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb span {
    margin: 0 0.5rem;
}

.page-header {
    text-align: center;
    margin-bottom: 3rem;
}

.page-icon {
    width: 64px;
    height: 64px;
    color: #3b82f6;
    margin: 0 auto 1rem;
}

.page-header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.page-subtitle {
    font-size: 1.125rem;
    color: #64748b;
}

.tool-section {
    max-width: 800px;
    margin: 0 auto;
}

.description {
    background: #f1f5f9;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    color: #475569;
    line-height: 1.7;
}

/* Form Styles - List Randomizer Specific */
.tool-form {
    background: #fff;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.help-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background: #6b7280;
    color: #fff;
    border-radius: 50%;
    font-size: 0.75rem;
    cursor: help;
    position: relative;
}

.help-icon:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: #fff;
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 1000;
    max-width: 200px;
    white-space: normal;
    word-wrap: break-word;
}

.form-group textarea {
    width: 100%;
    min-height: 150px;
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.5;
    resize: vertical;
    transition: border-color 0.3s ease;
}

.form-group textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #3b82f6;
}

.checkbox-group label {
    margin-bottom: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    background: none;
    white-space: nowrap;
}

.btn-primary {
    background: #3b82f6;
    color: #fff;
    border-color: #3b82f6;
}

.btn-primary:hover {
    background: #2563eb;
    border-color: #2563eb;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #64748b;
    color: #fff;
    border-color: #64748b;
}

.btn-secondary:hover {
    background: #475569;
    border-color: #475569;
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: #64748b;
    border-color: #e2e8f0;
}

.btn-outline:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

.icon-sm {
    width: 16px;
    height: 16px;
}

/* Result Box Styles - List Randomizer Specific */
.result-box {
    background: #fff;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
    margin-top: 2rem;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.result-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.result-stats {
    font-size: 0.875rem;
    color: #64748b;
    background: #f1f5f9;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
}

.result-content {
    margin-bottom: 1.5rem;
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    background: #f8fafc;
}

.result-item {
    display: flex;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e2e8f0;
}

.result-item:last-child {
    border-bottom: none;
}

.item-number {
    font-weight: 600;
    color: #3b82f6;
    min-width: 30px;
    margin-right: 0.5rem;
}

.result-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Message Styles */
.message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    z-index: 1001;
    max-width: 400px;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.message.show {
    transform: translateX(0);
}

.message.success {
    background: #10b981;
    color: #fff;
}

.message.error {
    background: #ef4444;
    color: #fff;
}

.message.info {
    background: #3b82f6;
    color: #fff;
}

/* SEO Content Styles */
.seo-content {
    max-width: 800px;
    margin: 4rem auto 0;
    background: #fff;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
}

.seo-content h2 {
    font-size: 1.875rem;
    color: #1e293b;
    margin-bottom: 1rem;
}

.seo-content h3 {
    font-size: 1.25rem;
    color: #1e293b;
    margin: 2rem 0 1rem;
}

.seo-content p {
    color: #475569;
    margin-bottom: 1rem;
    line-height: 1.7;
}

.seo-content ol,
.seo-content ul {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.seo-content li {
    color: #475569;
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

/* Footer Styles */
.footer {
    background: #1e293b;
    color: #94a3b8;
    padding: 2rem 0;
    margin-top: auto;
}

.footer-content {
    text-align: center;
}

.footer-content p {
    margin-bottom: 0.5rem;
}

.footer-contact a {
    color: #3b82f6;
    text-decoration: none;
}

.footer-contact a:hover {
    text-decoration: underline;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        top: 70px;
        left: 0;
        width: 100%;
        background: #fff;
        flex-direction: column;
        padding: 2rem;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }

    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }

    .hero-section h1 {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1.125rem;
    }

    .hero-description {
        font-size: 1rem;
    }

    .container {
        padding: 0 15px;
    }

    .main-content {
        padding: 1rem 0;
    }

    .tool-form,
    .result-box,
    .seo-content {
        padding: 1.5rem;
    }

    .result-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .result-actions {
        flex-direction: column;
    }

    .btn {
        justify-content: center;
        width: 100%;
    }

    .result-actions .btn {
        flex: 1;
        min-width: 0;
    }

    .tools-grid > div:not(h2) {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 480px) {
    .hero-section {
        padding: 2rem 0;
        margin-bottom: 2rem;
    }

    .hero-section h1 {
        font-size: 1.75rem;
    }

    .tool-card {
        padding: 1.5rem;
    }

    .message {
        left: 20px;
        right: 20px;
        max-width: none;
        transform: translateY(-100%);
    }

    .message.show {
        transform: translateY(0);
    }
}

/* Print Styles */
@media print {
    .header,
    .footer,
    .result-actions {
        display: none;
    }
    
    .main-content {
        padding: 0;
    }
    
    .result-box {
        box-shadow: none;
        border: 1px solid #000;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Focus styles for accessibility */
.btn:focus,
.nav-link:focus,
.brand-link:focus,
textarea:focus,
input:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .tool-card {
        border: 2px solid #000;
    }
    
    .btn {
        border-width: 2px;
    }
}