:root {
    --primary: #3B82F6;
    --primary-dark: #2563EB;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --bg-light: #F9FAFB;
    --bg-white: #FFFFFF;
    --text-dark: #111827;
    --text-muted: #6B7280;
    --border: #E5E7EB;
    --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);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", "San Francisco", "Helvetica Neue", sans-serif;
}

body {
    min-height: 100vh;
    background: var(--bg-light);
    color: var(--text-dark);
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* Navigation Styles */
nav {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    width: min(1200px, 95%);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dark);
}

.nav-logo svg {
    width: 28px;
    height: 28px;
}

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

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s ease;
}

.nav-links a:hover {
    color: var(--primary);
}

/* Dropdown Navigation Styles */
.nav-item-dropdown {
    position: relative;
}

.nav-link-dropdown {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.nav-link-dropdown::after {
    content: '▼';
    font-size: 0.65rem;
    transition: transform 0.2s ease;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 8px;
    list-style: none;
    margin-top: 0.5rem;
    padding: 0.5rem 0;
    min-width: 200px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    z-index: 101;
}

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

.dropdown-menu a {
    display: block;
    padding: 0.75rem 1.5rem;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.dropdown-menu a:hover {
    background: var(--bg-light);
    color: var(--primary);
    padding-left: 1.75rem;
}

.nav-item-dropdown:hover .nav-link-dropdown::after {
    transform: rotate(180deg);
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-dark);
    padding: 0.5rem;
    transition: transform 0.3s ease;
}

.container {
    width: min(1200px, 95%);
    margin: 0 auto;
    padding: 3rem 0;
}

main {
    display: block;
}

header {
    text-align: center;
    margin-bottom: 4rem;
}

.logo-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.logo {
    width: 60px;
    height: 60px;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.1));
}

header h1 {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--text-dark);
    margin: 0;
    letter-spacing: -2px;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.15rem;
    margin-top: 0.5rem;
    font-weight: 500;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.tool-card {
    padding: 2rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg-white);
    box-shadow: none;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.tool-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    border-color: var(--primary);
}

.tool-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 4rem;
    height: 4rem;
    margin-bottom: 1.25rem;
    border-radius: 8px;
    background: transparent;
    font-size: 2rem;
}

.tool-card h2 {
    margin-bottom: 0.75rem;
    color: var(--text-dark);
    font-size: 1.35rem;
    font-weight: 700;
}

.tool-card p {
    min-height: 60px;
    margin-bottom: 1rem;
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    flex-grow: 1;
}

.card {
    margin-top: 2rem;
    padding: 2.5rem;
    border-radius: 12px;
    background: var(--bg-white);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
}

.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.upload-header h2 {
    color: var(--text-dark);
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.back-btn {
    border: 1px solid var(--border);
    background: var(--bg-white);
    color: var(--text-dark);
    border-radius: 8px;
    padding: 0.75rem 1.25rem;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.back-btn:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.drop-zone {
    position: relative;
    padding: 6rem 2rem;
    border: 3px dashed #3B82F6;
    border-radius: 16px;
    text-align: center;
    cursor: pointer;
    background: #FFFFFF;
    transition: all 0.3s ease;
    margin-bottom: 2rem;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.drop-zone:hover {
    border-color: #2563EB;
    background: #F0F9FF;
}

.drop-zone.highlight {
    border-color: #2563EB;
    background: #E0F2FE;
    transform: scale(1.01);
}

.drop-zone input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.drop-text-main {
    color: var(--text-dark);
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
    pointer-events: none;
}

.drop-text-sub {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin: 0.75rem 0 0 0;
    pointer-events: none;
}

.convert-btn {
    width: 100%;
    padding: 1.1rem;
    border: none;
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.convert-btn:hover:not(:disabled) {
    background: #2563EB;
}

.convert-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.convert-btn:active:not(:disabled) {
    transform: scale(0.98);
}

.hidden {
    display: none !important;
}

.hidden-icon {
    display: none;
}

#status {
    margin-top: 1.25rem;
    padding: 1rem 1.25rem;
    border-radius: 8px;
    text-align: center;
    font-size: 0.95rem;
    font-weight: 500;
    min-height: 1.5rem;
    border-left: 4px solid;
}

#status.info {
    color: var(--primary);
    background: rgba(59, 130, 246, 0.1);
    border-left-color: var(--primary);
}

#status.success {
    color: var(--success);
    background: rgba(16, 185, 129, 0.1);
    border-left-color: var(--success);
}

#status.error {
    color: var(--error);
    background: rgba(239, 68, 68, 0.1);
    border-left-color: var(--error);
}

/* Progress Bar Animation */
@keyframes progress-slide {
    0% {
        transform: translateX(-100%);
    }
    50% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Progress Bar Styles */
#progressBar {
    width: 100%;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 1.25rem;
    margin-bottom: 1.25rem;
}

#progressBar .progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 3px;
    width: 40%;
    animation: progress-slide 2s ease-in-out infinite;
}

@media (max-width: 768px) {
    .nav-toggle {
        display: block;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-white);
        flex-direction: column;
        gap: 0;
        border-bottom: 1px solid var(--border);
        padding: 1rem 0;
        list-style: none;
        z-index: 99;
    }

    nav.nav-open .nav-links {
        display: flex;
    }

    .nav-links li {
        width: 100%;
    }

    .nav-links a {
        display: block;
        padding: 1rem 1.5rem;
        border-bottom: 1px solid var(--border);
        color: var(--text-muted);
        text-decoration: none;
        font-weight: 500;
    }

    .nav-links a:hover {
        background: var(--bg-light);
        color: var(--primary);
    }

    .nav-links li:last-child a {
        border-bottom: none;
    }

    /* Mobile Dropdown Styles */
    .dropdown-menu {
        position: static;
        opacity: 0;
        visibility: hidden;
        height: 0;
        overflow: hidden;
        margin-top: 0;
        box-shadow: none;
        border: none;
        background: var(--bg-light);
        transform: none;
        padding: 0;
        border-radius: 0;
        transition: opacity 0.2s ease, visibility 0.2s ease, height 0.2s ease;
    }

    .nav-item-dropdown.active .dropdown-menu {
        opacity: 1;
        visibility: visible;
        height: auto;
        padding: 0.5rem 0;
    }

    .dropdown-menu a {
        padding-left: 3rem;
        border-bottom: 1px solid var(--border);
        background: var(--bg-light);
    }

    .dropdown-menu a:hover {
        padding-left: 3rem;
    }

    .dropdown-menu li:last-child a {
        border-bottom: none;
    }

    .nav-item-dropdown:hover .nav-link-dropdown::after {
        transform: none;
    }

    .nav-item-dropdown.active .nav-link-dropdown::after {
        transform: rotate(180deg);
    }

    .nav-container {
        position: relative;
    }

    header h1 {
        font-size: 2.2rem;
    }

    .subtitle {
        font-size: 0.95rem;
    }

    .logo-section {
        flex-direction: column;
        gap: 0.75rem;
    }

    .tools-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .card {
        padding: 1.5rem;
    }

    .drop-zone {
        padding: 2rem 1rem;
        min-height: 250px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .upload-header {
        flex-direction: column;
        align-items: flex-start;
    }


    /* Touch Target Sizes (48px minimum for easy tapping) */
    .convert-btn {
        min-height: 48px;
        padding: 0.75rem 1rem;
    }

    .back-btn {
        min-height: 48px;
        padding: 0.75rem 1rem;
    }

    .summary-select {
        min-height: 48px;
        padding: 0.75rem;
    }
}

/* Hover Styles - Only for devices with actual hover capability (mice, trackpads) */
@media (hover: hover) and (pointer: fine) {
    .nav-links a:hover {
        color: var(--primary);
    }

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

    .nav-item-dropdown:hover .nav-link-dropdown::after {
        transform: rotate(180deg);
    }

    .dropdown-menu a:hover {
        background: var(--bg-light);
        color: var(--primary);
        padding-left: 1.75rem;
    }

    .tool-card:hover {
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
        border-color: var(--primary);
    }

    .back-btn:hover {
        background: var(--primary);
        color: #fff;
        border-color: var(--primary);
    }

    .drop-zone:hover {
        border-color: #2563EB;
        background: #F0F9FF;
    }

    .convert-btn:hover:not(:disabled) {
        background: #2563EB;
    }

    .summary-select:hover {
        border-color: var(--primary);
    }

    .copy-btn:hover {
        background: #2563EB;
    }

    .footer-column a:hover {
        color: var(--primary);
    }
}

/* AI Summarizer Styles */
#aiSummarizerSection {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.summary-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-dark);
}

.summary-select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    color: var(--text-dark);
    background: var(--bg-white);
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.summary-select:hover {
    border-color: var(--primary);
}

.summary-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

#summaryOutput {
    margin-top: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), rgba(139, 92, 246, 0.05));
    border-radius: 12px;
    border: 1px solid var(--border);
}

#summaryOutput h3 {
    margin-bottom: 1rem;
    color: var(--text-dark);
    font-size: 1.25rem;
}

.summary-info {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: var(--bg-white);
    border-radius: 8px;
    border-left: 4px solid var(--primary);
    font-size: 0.9rem;
    color: var(--text-muted);
}

.summary-box {
    margin-bottom: 1rem;
    padding: 1.5rem;
    background: var(--bg-white);
    border-radius: 10px;
    border: 1px solid var(--border);
    line-height: 1.8;
    color: var(--text-dark);
    min-height: 100px;
    max-height: 400px;
    overflow-y: auto;
}

.copy-btn {
    padding: 0.75rem 1.5rem;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.copy-btn:hover {
    background: #2563EB;
}

.copy-btn:active {
    transform: scale(0.98);
}

/* Footer Styles */
footer {
    background: #F3F4F6;
    border-top: 1px solid var(--border);
    margin-top: 4rem;
    padding: 3rem 0 1rem 0;
}

.footer-container {
    width: min(1200px, 95%);
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 3rem;
    padding-bottom: 2rem;
}

.footer-column h3 {
    color: var(--text-dark);
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

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

.footer-column ul li {
    margin-bottom: 0.75rem;
}

.footer-column a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.footer-column a:hover {
    color: var(--primary);
}

.footer-bottom {
    width: min(1200px, 95%);
    margin: 0 auto;
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.85rem;
}

.footer-bottom p {
    margin: 0;
}

/* Footer Section Styles (About, Contact, Privacy, Terms) */
.footer-section {
    padding: 3rem 0;
    border-bottom: 1px solid var(--border);
}

.footer-section:nth-child(odd) {
    background: var(--bg-white);
}

.footer-section:nth-child(even) {
    background: var(--bg-light);
}

.footer-section h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
}

.footer-section p {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.8;
    max-width: 600px;
}

@media (max-width: 768px) {
    footer {
        margin-top: 2rem;
        padding: 2rem 0 1rem 0;
    }

    .footer-container {
        gap: 1.5rem;
        padding-bottom: 1rem;
    }

    .footer-column h3 {
        font-size: 0.9rem;
    }

    .footer-column a {
        font-size: 0.85rem;
    }
}
