/* TurnFile 360 - Main CSS Bundle (Async Loaded) */
/* Components + Mobile + Smart Upload + Overflow Fix + Mobile Fixes */

/* COMPONENTS */
.navbar-v2.scrolled {
    box-shadow: var(--shadow-md)
}

.logo-v2:hover {
    transform: scale(1.02)
}

.logo-icon-v2 {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 1.75rem
}

.nav-link-v2 {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s ease;
    position: relative
}

.nav-link-v2::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-gradient);
    transition: width 0.3s ease
}

.nav-link-v2:hover,
.nav-link-v2.active {
    color: var(--primary-600)
}

.nav-link-v2:hover::after,
.nav-link-v2.active::after {
    width: 100%
}

.btn-contact-v2 {
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-light);
    background: white;
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.2s ease
}

.btn-contact-v2:hover {
    border-color: var(--primary-600);
    color: var(--primary-600);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px)
}

.mobile-menu-btn-v2 {
    display: none;
    background: none;
    border: none;
    color: var(--text-main);
    cursor: pointer;
    padding: 0.5rem;
    transition: transform 0.2s ease
}

.mobile-menu-btn-v2:hover {
    transform: scale(1.1)
}

.footer-v2 {
    background: white;
    border-top: 1px solid var(--border-light);
    padding: 3rem 0;
    margin-top: auto
}

.footer-content {
    text-align: center;
    color: var(--text-secondary)
}

.footer-links-v2 {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap
}

.footer-link-v2 {
    color: #475569;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s ease
}

.footer-link-v2:hover {
    color: var(--primary-600)
}

.copyright {
    font-size: 0.875rem;
    color: #475569
}

.btn-primary {
    padding: 1rem 2.5rem;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.4);
    filter: brightness(1.1)
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0)
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed
}

.btn-secondary {
    padding: 1rem 2.5rem;
    background: white;
    color: var(--text-main);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem
}

.btn-secondary:hover {
    border-color: var(--primary-600);
    color: var(--primary-600);
    transform: translateY(-1px)
}

.btn-upload {
    padding: 0.75rem 1.5rem;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease
}

.btn-upload:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3)
}

.tool-card {
    background: white;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1rem;
    text-align: left;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    gap: 0.35rem
}

.tool-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: #A5B4FC
}

.tool-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem
}

.tool-name {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-main)
}

.tool-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.3
}

.tool-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: #ECFDF5;
    color: #059669;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em
}

.option-card {
    background: white;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative
}

.option-card:hover {
    border-color: #A5B4FC;
    background: #F5F7FF
}

.option-card.selected {
    border-color: var(--primary-600);
    background: #EEF2FF;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1)
}

.option-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer
}

.feature-card {
    text-align: center
}

.feature-icon {
    width: 56px;
    height: 56px;
    background: #F0FDF4;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.75rem
}

.feature-title {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--text-main)
}

.feature-desc {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 0.75rem
}

@media(max-width:1400px) {
    .tools-grid {
        grid-template-columns: repeat(5, 1fr) !important
    }
}

@media(max-width:1200px) {
    .tools-grid {
        grid-template-columns: repeat(4, 1fr) !important
    }
}

@media(max-width:900px) {
    .tools-grid {
        grid-template-columns: repeat(3, 1fr) !important
    }
}

.features-grid {
    max-width: 1000px;
    margin: 3rem auto 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2.5rem
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: white;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: var(--shadow-sm)
}

.badge-primary {
    color: var(--primary-600);
    border-color: var(--primary-600);
    background: #EEF2FF
}

.badge-success {
    color: #059669;
    border-color: #059669;
    background: #ECFDF5
}

/* MOBILE STYLES */
@media(max-width:768px) {
    .nav-menu-v2 {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: 1rem;
        box-shadow: var(--shadow-lg);
        border-top: 1px solid var(--border-light)
    }

    .nav-menu-v2.active {
        display: flex
    }

    .mobile-menu-btn-v2 {
        display: block
    }

    .tools-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem
    }

    .hero-title {
        font-size: 2.5rem
    }

    .hero-subtitle {
        font-size: 1.05rem
    }

    .section-title {
        font-size: 2rem
    }
}

/* SMART UPLOAD - Complete Styles */
.smart-upload-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 280px;
    padding: 3rem 2rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(248, 250, 252, 0.98));
    border: 2px dashed rgba(102, 126, 234, 0.4);
    border-radius: 24px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden
}

.smart-upload-zone::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #667eea08, #764ba208);
    opacity: 0;
    transition: opacity 0.25s
}

.smart-upload-zone:hover,
.smart-upload-zone.drag-over {
    border-color: #667eea;
    border-style: solid;
    transform: translateY(-2px);
    box-shadow: 0 20px 40px rgba(102, 126, 234, 0.15)
}

.smart-upload-zone:hover::before,
.smart-upload-zone.drag-over::before {
    opacity: 1
}

.smart-upload-zone.drag-over {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08), rgba(118, 75, 162, 0.05));
    border-width: 3px
}

.upload-content {
    position: relative;
    z-index: 1;
    text-align: center
}

.upload-icon {
    color: #667eea;
    margin-bottom: 1.25rem;
    animation: float 3s ease-in-out infinite
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0)
    }

    50% {
        transform: translateY(-8px)
    }
}

.upload-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 0.5rem;
    letter-spacing: -0.02em
}

.upload-subtitle {
    color: #64748b;
    font-size: 1rem;
    margin: 0 0 1.5rem
}

.upload-formats {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem
}

.upload-formats span {
    background: linear-gradient(135deg, #667eea15, #764ba210);
    color: #667eea;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.375rem 0.875rem;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.03em
}

.upload-hint {
    color: #94a3b8;
    font-size: 0.825rem;
    margin: 0
}

.upload-hint kbd {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-family: inherit;
    font-weight: 600
}

.upload-result {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.99));
    border-radius: 24px;
    padding: 2rem;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(102, 126, 234, 0.15)
}

.file-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #667eea08, #764ba205);
    border-radius: 14px;
    margin-bottom: 1.5rem
}

.file-icon {
    font-size: 2rem
}

.file-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem
}

.file-name {
    font-weight: 600;
    color: #1e293b;
    font-size: 1rem;
    word-break: break-all
}

.file-size {
    color: #64748b;
    font-size: 0.85rem
}

.file-remove {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fee2e2;
    color: #ef4444;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.15s
}

.file-remove:hover {
    background: #fecaca;
    transform: scale(1.05)
}

.tools-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 1rem;
    text-align: center
}

.tool-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1rem;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1)
}

.tool-button:hover {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea08, #764ba208);
    transform: translateY(-3px);
    box-shadow: 0 12px 24px rgba(102, 126, 234, 0.15)
}

.inline-search-wrapper {
    position: relative
}

.inline-search-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    transition: all 0.2s
}

.inline-search-bar:focus-within {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15)
}

.inline-search-bar svg {
    color: #94a3b8;
    flex-shrink: 0
}

.inline-search-bar input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 0.9rem;
    color: #1e293b;
    background: transparent
}

.inline-search-bar input::placeholder {
    color: #94a3b8
}

.inline-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    z-index: 100
}

.inline-search-item {
    display: block;
    padding: 0.75rem 1rem;
    color: #1e293b;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.15s
}

.inline-search-item:last-child {
    border-bottom: none
}

.inline-search-item:hover {
    background: linear-gradient(90deg, #667eea08, #764ba208)
}

@media(max-width:640px) {
    .smart-upload-zone {
        min-height: 220px;
        padding: 2rem 1.5rem
    }

    .upload-icon svg {
        width: 48px;
        height: 48px
    }

    .upload-title {
        font-size: 1.35rem
    }

    .upload-formats span {
        font-size: 0.7rem;
        padding: 0.3rem 0.7rem
    }

    .tools-grid {
        grid-template-columns: repeat(2, 1fr)
    }

    .upload-result {
        padding: 1.5rem
    }
}

/* OVERFLOW FIX */
html,
body {
    overflow-x: hidden;
    max-width: 100vw
}

* {
    max-width: 100%
}

img,
video,
iframe {
    max-width: 100%;
    height: auto
}

.container,
.container-wide,
.container-narrow {
    overflow-x: hidden
}

/* MOBILE FIXES */
@media(max-width:600px) {
    .tools-grid-home {
        grid-template-columns: repeat(2, 1fr) !important
    }

    .tool-card-home {
        padding: 0.875rem
    }

    .tool-icon-home {
        width: 36px;
        height: 36px;
        font-size: 1.125rem
    }

    .tool-name-home {
        font-size: 0.85rem
    }

    .tool-desc-home {
        font-size: 0.7rem
    }
}