/* ============================================================================
   PDFDaddy Enterprise Styling - Professional Grade
   ============================================================================ */

:root {
    --primary: #1f2937;
    --primary-light: #374151;
    --accent: #f56565;
    --accent-light: #fc8181;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #3b82f6;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

/* ============================================================================
   Base Styling
   ============================================================================ */

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: #ffffff;
    color: var(--gray-900);
    line-height: 1.6;
}

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

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

.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 clamp(16px, 2vw, 32px);
}

/* ============================================================================
   Header & Navigation - Professional Layout
   ============================================================================ */

.site-header {
    background: #ffffff;
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    box-shadow: var(--shadow-sm);
}

.navbar {
    max-width: none;
    margin: 0;
    padding: 1.25rem 0;
    display: block;
    height: auto;
}

.navbar .container {
    max-width: 100%;
    padding: 0 clamp(16px, 2vw, 32px);
}

.navbar-brand {
    flex-shrink: 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--primary);
    font-weight: 700;
    font-size: 20px;
    transition: color 0.2s ease;
}

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

.logo-icon {
    font-size: 28px;
    display: flex;
    align-items: center;
}

.logo-text {
    font-size: 18px;
    letter-spacing: -0.5px;
}

.logo-beta {
    font-size: 11px;
    background: var(--accent);
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* Desktop-only navbar styles - don't apply on mobile */
@media (min-width: 769px) {
    .navbar-menu {
        flex: 1;
        display: flex;
        justify-content: flex-end;
        padding: 0;
        min-width: 0;
    }

    .navbar-nav {
        display: flex;
        gap: var(--space-4);
        align-items: center;
        justify-content: flex-end;
        flex-wrap: wrap;
        row-gap: var(--space-2);
    }
}

.nav-link {
    color: var(--gray-700);
    font-weight: 500;
    font-size: 15px;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link:hover {
    color: var(--accent);
    background-color: rgba(245, 101, 101, 0.05);
    text-decoration: none;
}

.nav-icon {
    font-size: 18px;
}

.nav-item {
    display: flex;
    align-items: center;
}

.usage-badge {
    padding: 8px 16px;
    background-color: var(--gray-50);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
}

.badge-pro {
    background: linear-gradient(135deg, var(--accent), #fc8181);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
}

.usage-bar {
    width: 200px;
    height: 6px;
    background-color: var(--gray-200);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.usage-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-light));
    border-radius: 3px;
    transition: width 0.3s ease;
}

.usage-text {
    font-size: 12px;
    color: var(--gray-600);
}

/* Dropdown Menu */
.dropdown {
    position: relative;
}

.dropdown-toggle {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-weight: 500;
}

.dropdown-toggle:hover {
    background-color: var(--gray-100);
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--accent), var(--info));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    min-width: 280px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1000;
}

.dropdown-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-header {
    padding: 16px;
    border-bottom: 1px solid var(--gray-200);
}

.user-email {
    font-weight: 600;
    color: var(--gray-900);
    font-size: 14px;
}

.user-tier {
    font-size: 12px;
    color: var(--gray-600);
    margin-top: 4px;
}

.dropdown-divider {
    height: 1px;
    background-color: var(--gray-200);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--gray-700);
    font-size: 14px;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background-color: var(--gray-50);
    color: var(--accent);
    text-decoration: none;
}

.dropdown-item.highlight {
    background-color: rgba(245, 101, 101, 0.05);
    color: var(--accent);
    font-weight: 600;
}

/* ============================================================================
   Flash Messages - Enhanced
   ============================================================================ */

.flash-messages {
    max-width: 100%;
    margin: 0 auto;
    padding: 24px clamp(16px, 2vw, 32px);
}

.alert {
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideDown 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    border-left: 4px solid;
}

@keyframes slideDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

.alert-danger,
.alert-error {
    background-color: #fef2f2;
    border-left-color: var(--error);
    color: #7f1d1d;
}

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

.alert-info {
    background-color: #eff6ff;
    border-left-color: var(--info);
    color: #0c2d6b;
}

.alert-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.alert-icon svg {
    width: 20px;
    height: 20px;
}

.alert-message {
    flex: 1;
    font-size: 15px;
    line-height: 1.5;
}

.alert-close {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 20px;
    padding: 0;
    flex-shrink: 0;
    transition: opacity 0.2s;
}

.alert-close:hover {
    opacity: 0.7;
}

/* ============================================================================
   Loading Overlay - Professional
   ============================================================================ */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(31, 41, 55, 0.95);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-spinner {
    text-align: center;
    color: white;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(245, 101, 101, 0.2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

#loading-text {
    color: white;
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 8px;
}

/* Progress Bar */
.progress-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.progress-bar-bg {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #fc8181);
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(245, 101, 101, 0.5);
}

.progress-text {
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    font-weight: 600;
}

/* ============================================================================
   Toast Notifications - Enhanced
   ============================================================================ */

#toast-container {
    position: fixed;
    top: 100px;
    right: 24px;
    z-index: 9998;
    max-width: 420px;
}

.toast {
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow-xl);
    padding: 16px 20px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    border-left: 4px solid var(--success);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast-error {
    border-left-color: var(--error);
}

.toast-warning {
    border-left-color: var(--warning);
}

.toast-info {
    border-left-color: var(--info);
}

.toast-icon {
    flex-shrink: 0;
    font-weight: 700;
    font-size: 18px;
}

.toast-message {
    flex: 1;
    font-size: 14px;
    line-height: 1.5;
}

.toast-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray-400);
    font-size: 20px;
    padding: 0;
    flex-shrink: 0;
    transition: color 0.2s;
}

.toast-close:hover {
    color: var(--gray-700);
}

/* ============================================================================
   Scroll to Top Button - Professional
   ============================================================================ */

#scroll-to-top {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 48px;
    height: 48px;
    background: var(--accent);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: var(--shadow-lg);
    font-weight: 700;
}

#scroll-to-top:not(.hidden) {
    opacity: 1;
    visibility: visible;
}

#scroll-to-top:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    background: var(--accent-light);
}

#scroll-to-top:active {
    transform: translateY(-2px);
}

#scroll-to-top svg {
    width: 20px;
    height: 20px;
    stroke-width: 2.5;
}

/* ============================================================================
   Quick Tools Bar
   ============================================================================ */

.quick-tools-bar {
    position: fixed;
    top: var(--navbar-height, 72px);
    left: 0;
    right: 0;
    background: white;
    border-bottom: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
    opacity: 1;
    visibility: visible;
    transition: all 0.3s ease;
    z-index: 99;
}

.quick-tools-bar.hidden {
    opacity: 0;
    visibility: hidden;
    transform: translateY(-100%);
}

.quick-tools {
    max-width: 100%;
    margin: 0 auto;
    padding: 12px clamp(16px, 2vw, 32px);
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.quick-tool {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 6px;
    background-color: var(--gray-50);
    color: var(--gray-700);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
}

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

.tool-icon {
    font-size: 16px;
}

/* ============================================================================
   Footer - Professional & Organized
   ============================================================================ */

.footer {
    background: var(--primary);
    color: white;
    margin-top: 80px;
}

.footer .container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 clamp(16px, 2vw, 32px);
}

.trust-indicators {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 32px;
    padding: 48px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.trust-item {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.trust-icon {
    font-size: 32px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.trust-content {
    flex: 1;
}

.trust-content strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
    font-weight: 700;
}

.trust-content p {
    font-size: 14px;
    opacity: 0.8;
    line-height: 1.5;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 40px;
    padding: 48px 0;
}

.footer-col h4 {
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 20px;
    letter-spacing: 0.5px;
}

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

.footer-col li {
    margin-bottom: 12px;
}

.footer-col a {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    transition: all 0.2s ease;
}

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

.link-primary {
    color: var(--accent) !important;
    font-weight: 600;
}

.footer-brand {
    order: -1;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 18px;
    margin-bottom: 16px;
}

.footer-logo span:first-child {
    font-size: 24px;
}

.footer-col > p:first-of-type {
    font-size: 14px;
    opacity: 0.8;
    line-height: 1.6;
    margin-bottom: 20px;
}

.social-links {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.social-link {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.2s ease;
}

.social-link:hover {
    background: var(--accent);
    transform: translateY(-2px);
}

.newsletter-signup {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.newsletter-signup h4 {
    margin-bottom: 12px;
    font-size: 14px;
}

.newsletter-form {
    display: flex;
    gap: 8px;
}

.newsletter-form input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    color: white;
    font-size: 13px;
    transition: all 0.2s ease;
}

.newsletter-form input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.newsletter-form input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent);
}

.newsletter-form button {
    padding: 10px 16px;
    background: var(--accent);
    border: none;
    border-radius: 6px;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
}

.newsletter-form button:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.footer-bottom {
    max-width: 100%;
    margin: 0 auto;
    padding: 24px clamp(16px, 2vw, 32px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 24px;
}

.footer-bottom-left p {
    font-size: 13px;
    opacity: 0.7;
    margin: 0;
}

.footer-tagline {
    margin-top: 4px;
}

.trust-badges-footer {
    display: flex;
    gap: 16px;
    font-size: 12px;
}

.trust-badges-footer span {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

/* ============================================================================
   Cookie Consent Banner - Professional
   ============================================================================ */

.cookie-consent {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-xl);
    padding: 24px;
    max-width: 420px;
    z-index: 998;
    animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.cookie-consent.hidden {
    display: none;
}

.cookie-content {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.cookie-icon {
    font-size: 32px;
    flex-shrink: 0;
    line-height: 1;
}

.cookie-text {
    flex: 1;
}

.cookie-text p {
    margin: 4px 0;
    font-size: 14px;
    color: var(--gray-600);
    line-height: 1.5;
}

.cookie-text strong {
    display: block;
    font-size: 15px;
    color: var(--gray-900);
    margin-bottom: 8px;
    font-weight: 700;
}

.cookie-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.cookie-actions button {
    padding: 8px 16px;
    border-radius: 6px;
    border: 1px solid var(--gray-300);
    background: white;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
    color: var(--gray-700);
}

.cookie-actions button:hover {
    background-color: var(--gray-50);
    border-color: var(--gray-400);
}

.cookie-actions button.accept {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.cookie-actions button.accept:hover {
    background: var(--accent-light);
    border-color: var(--accent-light);
}

.btn-link {
    color: var(--accent);
    font-size: 13px;
    font-weight: 600;
    padding: 8px 0;
}

.btn-link:hover {
    color: var(--accent-light);
}

/* ============================================================================
   Skip Link - Accessibility
   ============================================================================ */

.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary);
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    z-index: 100;
    font-weight: 600;
    border-radius: 0 0 6px 0;
}

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

/* ============================================================================
   Responsive Design
   ============================================================================ */

@media (max-width: 768px) {
    .navbar {
        height: auto;
        flex-wrap: wrap;
        padding: 0.5rem 0.75rem !important;
    }

    /* CRITICAL: Hide menu on mobile - let main.css handle it */
    .navbar-menu {
        display: none !important;
        flex: none;
        width: 100%;
        padding: var(--space-4) 0;
        justify-content: flex-start;
        position: fixed !important;
        top: 60px !important;
        left: 0;
        right: 0;
        background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
        z-index: 1001 !important;
        max-height: calc(100vh - 60px);
        overflow-y: auto;
        box-shadow: 0 6px 24px rgba(37, 99, 235, 0.4);
    }

    .navbar-menu.active {
        display: block !important;
    }

    .navbar-nav {
        display: flex;
        flex-direction: column;
        gap: var(--space-2);
        padding: 0 var(--space-4);
        width: 100%;
    }

    .nav-link {
        width: 100%;
        text-align: left;
        padding: 1rem var(--space-4);
        display: flex;
        align-items: center;
        gap: 0.85rem;
        background: rgba(255, 255, 255, 0.08);
        border: 1px solid rgba(251, 191, 36, 0.2);
        margin-bottom: var(--space-1);
        min-height: 48px;
        font-size: 1.1rem;
        font-weight: 700;
        border-radius: 8px;
        color: #ffffff !important;
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    }

    .nav-link:hover {
        background: rgba(251, 191, 36, 0.2);
        color: #fbbf24 !important;
    }

    .nav-icon {
        font-size: 1.85rem;
        line-height: 1;
        filter: brightness(1.25);
    }

    .usage-bar {
        width: 120px;
    }

    .usage-badge {
        width: 100%;
        margin: var(--space-2) 0;
        padding: var(--space-3) var(--space-4);
        background: rgba(255, 255, 255, 0.1);
    }

    .dropdown-toggle {
        width: 100%;
        justify-content: space-between;
        background: rgba(251, 191, 36, 0.2);
        min-height: 48px;
        font-size: 1.1rem;
        color: #ffffff !important;
    }

    .dropdown-menu {
        position: relative;
        top: 0;
        right: auto;
        width: 100%;
        margin-top: var(--space-2);
        opacity: 1;
        visibility: visible;
        transform: none;
    }

    .dropdown-menu.active {
        display: block;
    }

    #toast-container {
        right: 12px;
        left: 12px;
        top: 80px;
        max-width: none;
    }

    #scroll-to-top {
        bottom: 24px;
        right: 24px;
        width: 44px;
        height: 44px;
    }

    .cookie-consent {
        bottom: 16px;
        right: 16px;
        left: 16px;
        max-width: none;
    }

    .footer-bottom {
        flex-direction: column;
        align-items: flex-start;
    }

    .trust-badges-footer {
        flex-wrap: wrap;
    }
}

@media (max-width: 640px) {
    .container {
        padding: 0 0.75rem !important;
        max-width: 100% !important;
    }

    .navbar {
        padding: 0.5rem 0 !important;
    }

    .navbar .container {
        padding: 0 0.75rem !important;
    }

    .logo {
        gap: 0.35rem !important;
        font-size: 1.15rem !important;
    }

    .logo-icon {
        font-size: 1.5rem !important;
    }

    .logo-text {
        font-size: 1.15rem !important;
    }

    .logo-beta {
        font-size: 0.5rem !important;
        padding: 0.15rem 0.35rem !important;
        margin-left: 0.25rem !important;
    }

    .navbar-toggle {
        display: flex;
    }

    .nav-link {
        font-size: 14px;
        padding: 6px 8px;
    }

    .dropdown-menu {
        right: -10px;
        min-width: 240px;
    }

    .footer-content {
        gap: 24px;
    }

    .footer {
        margin-top: 40px;
    }
}

/* ============================================================================
   Print Styles
   ============================================================================ */

@media print {
    .site-header,
    .footer,
    #scroll-to-top,
    .cookie-consent,
    .loading-overlay,
    #toast-container {
        display: none !important;
    }

    body {
        background: white;
    }
}

/* ============================================================================
   Dark Mode Support (Disabled - Light Theme Only)
   ============================================================================ */

/* Dark mode disabled to maintain consistent light theme branding */
