/* LinkFlow Custom Styles */

:root {
    --primary-50: #f0f9ff;
    --primary-100: #e0f2fe;
    --primary-500: #0ea5e9;
    --primary-600: #0284c7;
    --primary-700: #0369a1;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #3b82f6;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    color: #374151;
    background-color: #f9fafb;
    overflow-x: hidden;
    width: 100%;
}

html {
    overflow-x: hidden;
}

/* Container */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border-radius: 0.5rem;
    transition: all 0.3s;
    cursor: pointer;
    border: none;
}

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

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

.btn-secondary {
    background-color: #e5e7eb;
    color: #374151;
}

.btn-secondary:hover {
    background-color: #d1d5db;
}

.btn-lg {
    padding: 0.75rem 2rem;
    font-size: 1.125rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #374151;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.form-error {
    color: var(--error);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.form-help {
    color: #6b7280;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Alerts */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    border-left: 4px solid;
}

.alert-success {
    background-color: #d1fae5;
    border-color: var(--success);
    color: #065f46;
}

.alert-error {
    background-color: #fee2e2;
    border-color: var(--error);
    color: #991b1b;
}

.alert-warning {
    background-color: #fef3c7;
    border-color: var(--warning);
    color: #92400e;
}

.alert-info {
    background-color: #dbeafe;
    border-color: var(--info);
    color: #1e40af;
}

/* Cards */
.card {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
}

/* Header */
.header {
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 1rem 0;
}

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

.header-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-600);
    text-decoration: none;
}

.header-menu {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.header-menu a {
    color: #374151;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.header-menu a:hover {
    color: var(--primary-600);
}

/* Footer */
.footer {
    background: #1f2937;
    color: #d1d5db;
    padding: 2rem 0;
    margin-top: 4rem;
    text-align: center;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-700) 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

/* Utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }

/* Responsive */
@media (max-width: 768px) {
    .hero h1 { font-size: 2rem; }
    .hero p { font-size: 1rem; }
}

/* Mobile Responsive Fixes */
@media (max-width: 768px) {
    .container {
        padding: 0 0.75rem;
    }

    .card {
        padding: 1rem;
        margin-bottom: 1rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    h1 {
        font-size: 1.5rem !important;
    }

    h2 {
        font-size: 1.125rem !important;
    }

    /* Prevent text overflow */
    * {
        max-width: 100%;
        word-wrap: break-word;
    }

    /* Fix buttons on mobile */
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
        white-space: normal !important;
        text-align: center;
    }


    /* Fix form inputs on mobile */
    .form-input,
    .form-select,
    .form-textarea {
        width: 100%;
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 0.5rem;
    }

    /* Further reduce padding on very small screens */
    .card {
        padding: 0.75rem;
    }
}


/* ========== Mobile Menu Styles ========== */

/* Mobile Menu Toggle Button (Hamburger) */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
}

.mobile-menu-toggle span {
    display: block;
    width: 24px;
    height: 3px;
    background-color: var(--primary-600);
    transition: all 0.3s ease;
    border-radius: 2px;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Button sizes */
.btn-sm {
    padding: 0.4rem 1rem;
    font-size: 0.875rem;
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-menu-overlay.active {
    display: block;
    opacity: 1;
}

/* Mobile Responsive (phones and tablets) */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex !important;
    }

    .header-nav {
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        position: relative;
    }

    .header-menu {
        display: flex;
        position: fixed;
        top: 0;
        right: -100%;
        bottom: 0;
        width: 280px;
        max-width: 80vw;
        background: white;
        flex-direction: column;
        gap: 0;
        margin: 0;
        padding: 1rem 0;
        z-index: 10000;
        box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
        overflow-y: auto;
        border-left: 3px solid var(--primary-600);
        transition: right 0.3s ease;
    }

    .header-menu.active {
        right: 0;
    }

    /* Menu header */
    .header-menu::before {
        content: 'Menu';
        display: block;
        padding: 1rem 1.5rem;
        font-size: 1.25rem;
        font-weight: 600;
        border-bottom: 1px solid #e5e7eb;
        margin-bottom: 0.5rem;
        color: #1f2937;
    }

    .header-menu li {
        width: 100%;
        text-align: left;
        margin: 0;
        display: block;
        list-style: none;
    }

    .header-menu a {
        display: block;
        padding: 1rem 1.5rem;
        width: 100%;
        color: #374151;
        text-decoration: none;
        transition: background 0.2s, color 0.2s;
        font-size: 1rem;
        font-weight: 500;
    }

    .header-menu a:hover {
        background: #f3f4f6;
        color: var(--primary-600);
    }

    .header-menu form {
        display: block;
        padding: 0;
        width: 100%;
    }

    .header-menu .btn {
        width: calc(100% - 3rem);
        text-align: center;
        margin: 0.5rem 1.5rem;
        border-radius: 0.375rem;
        display: block;
        padding: 0.75rem 1rem;
    }

    .header {
        padding: 0.75rem 0;
    }

    /* Prevent body scroll when menu is open */
    body.menu-open {
        overflow: hidden;
    }
}

/* Desktop (larger screens) */
@media (min-width: 769px) {
    .mobile-menu-toggle {
        display: none !important;
    }

    .header-menu {
        display: flex !important;
        position: static !important;
        flex-direction: row !important;
        opacity: 1 !important;
        transform: none !important;
        box-shadow: none !important;
        border: none !important;
        background: transparent !important;
    }
}
