/* ==========================================================================
   GoConverter Theme Styles - Final Version
   ========================================================================== */

:root {
    --primary: #4361ee;
    --secondary: #3a0ca3;
    --accent: #4cc9f0;
    --light: #f8f9fa;
    --dark: #212529;
    --success: #4bb543;
    --warning: #ffcc00;
    --danger: #dc3545;
    --gray: #6c757d;
    --light-gray: #e9ecef;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 8px 25px rgba(0, 0, 0, 0.15);
    --radius: 12px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    color: var(--dark);
    background-color: #ffffff;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ==========================================================================
   Header Styles
   ========================================================================== */

.site-header {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo a {
    color: white;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo i {
    font-size: 1.8rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 10px;
    border-radius: 10px;
}

/* Navigation */
.primary-menu {
    display: flex;
    list-style: none;
    gap: 2px;
    margin: 0;
    padding: 0;
}

.primary-menu li a {
    color: white;
    text-decoration: none;
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 500;
    transition: var(--transition);
    white-space: nowrap;
}

.primary-menu li a:hover,
.primary-menu li a:focus {
    background: rgba(255, 255, 255, 0.15);
    outline: none;
}

.primary-menu li.current-menu-item a {
    background: rgba(255, 255, 255, 0.2);
    font-weight: 600;
}

/* Auth Buttons */
.auth-buttons {
    display: flex;
    gap: 12px;
}

.btn {
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    border: 2px solid transparent;
    cursor: pointer;
    font-size: 0.95rem;
    display: inline-block;
    text-align: center;
}

.btn:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.btn-primary {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.btn-primary:hover {
    background: #3ab0d5;
    border-color: #3ab0d5;
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: white;
    border-color: white;
}

.btn-outline:hover {
    background: white;
    color: var(--primary);
    transform: translateY(-2px);
}

/* ==========================================================================
   Hero Section
   ========================================================================== */

.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 100px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 100" fill="%23ffffff" opacity="0.1"><polygon points="1000,100 1000,0 0,100"/></svg>');
    background-size: cover;
}

.hero .container {
    position: relative;
    z-index: 2;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.hero-description {
    font-size: 1.3rem;
    margin-bottom: 2.5rem;
    opacity: 0.9;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.hero-actions .btn {
    padding: 15px 35px;
    font-size: 1.1rem;
    border-radius: 50px;
    min-width: 160px;
}

/* ==========================================================================
   Tools Section
   ========================================================================== */

.converter-tools {
    padding: 80px 0;
    background: var(--light);
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 3rem;
    color: var(--dark);
}

.section-title::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background: linear-gradient(to right, var(--primary), var(--accent));
    margin: 1rem auto;
    border-radius: 2px;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-top: 2rem;
}

.tool-card {
    background: white;
    border-radius: var(--radius);
    padding: 40px 30px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
    text-decoration: none;
    color: inherit;
    border: 1px solid var(--light-gray);
    position: relative;
    overflow: hidden;
}

.tool-card:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(to right, var(--primary), var(--accent));
}

.tool-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-hover);
}

.tool-icon {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tool-card h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--dark);
}

.tool-card p {
    color: var(--gray);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.tool-btn {
    display: inline-block;
    padding: 12px 30px;
    background: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    transition: var(--transition);
    border: 2px solid var(--primary);
}

.tool-card:hover .tool-btn {
    background: var(--secondary);
    border-color: var(--secondary);
    transform: translateY(-2px);
}

/* ==========================================================================
   Features Section
   ========================================================================== */

.features {
    padding: 80px 0;
    background: white;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
}

.feature-card {
    text-align: center;
    padding: 40px 20px;
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feature-card h3 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--dark);
}

.feature-card p {
    color: var(--gray);
    line-height: 1.6;
}

/* ==========================================================================
   Converter Page Styles
   ========================================================================== */

.converter-page {
    padding: 60px 0;
    min-height: 80vh;
}

.converter-container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 50px;
    border: 1px solid var(--light-gray);
}

.converter-header {
    text-align: center;
    margin-bottom: 3rem;
}

.converter-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--dark);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.converter-header h1 i {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 2.8rem;
}

.converter-header p {
    font-size: 1.2rem;
    color: var(--gray);
    max-width: 600px;
    margin: 0 auto;
}

/* Upload Area */
.upload-area {
    border: 3px dashed var(--light-gray);
    border-radius: var(--radius);
    padding: 60px 40px;
    text-align: center;
    margin-bottom: 2rem;
    transition: var(--transition);
    cursor: pointer;
    background: #fafbff;
}

.upload-area:hover {
    border-color: var(--primary);
    background: #f8f9ff;
}

.upload-area.dragover {
    border-color: var(--primary);
    background: #f0f4ff;
    transform: scale(1.02);
}

.upload-area.loading {
    pointer-events: none;
    opacity: 0.7;
}

.upload-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.upload-area h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--dark);
}

.upload-area p {
    color: var(--gray);
    margin-bottom: 0.5rem;
}

.upload-area .small {
    font-size: 0.9rem;
    color: var(--gray);
}

.file-input {
    display: none;
}

/* File Preview */
.file-preview {
    display: none;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: white;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    border: 1px solid var(--light-gray);
    border-left: 4px solid var(--primary);
}

.file-preview.active {
    display: flex;
    animation: fadeIn 0.6s ease-out;
}

.file-icon {
    font-size: 2.5rem;
    color: var(--primary);
}

.file-details {
    flex: 1;
}

.file-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
    word-break: break-all;
}

.file-size {
    color: var(--gray);
    font-size: 0.9rem;
}

.file-remove {
    background: none;
    border: none;
    color: var(--danger);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: var(--transition);
}

.file-remove:hover {
    background: var(--danger);
    color: white;
}

/* Progress Bar */
.conversion-progress {
    display: none;
    margin: 2rem 0;
}

.conversion-progress.active {
    display: block;
    animation: fadeIn 0.6s ease-out;
}

.progress-bar {
    height: 8px;
    background: var(--light-gray);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(to right, var(--primary), var(--accent));
    border-radius: 4px;
    width: 0%;
    transition: width 0.4s ease;
}

.progress-text {
    text-align: center;
    color: var(--gray);
    font-size: 0.9rem;
}

/* Results Section */
.conversion-results {
    display: none;
    margin-top: 2rem;
    padding: 2rem;
    background: var(--light);
    border-radius: var(--radius);
    border-left: 4px solid var(--success);
    animation: fadeIn 0.6s ease-out;
}

.conversion-results.active {
    display: block;
}

.result-success {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 1.5rem;
}

.result-success i {
    font-size: 2.5rem;
    color: var(--success);
}

.result-content h3 {
    color: var(--success);
    margin-bottom: 0.5rem;
}

.result-content p {
    color: var(--gray);
    margin-bottom: 0;
}

.result-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.btn-success {
    background: var(--success);
    color: white;
    border-color: var(--success);
}

.btn-success:hover {
    background: #3fa535;
    border-color: #3fa535;
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--gray);
    color: white;
    border-color: var(--gray);
}

.btn-secondary:hover {
    background: #5a6268;
    border-color: #5a6268;
    transform: translateY(-2px);
}

/* Convert Button */
.convert-btn {
    display: block;
    width: 100%;
    padding: 18px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 2rem;
}

.convert-btn:hover:not(:disabled) {
    background: var(--secondary);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(67, 97, 238, 0.3);
}

.convert-btn:disabled {
    background: var(--gray);
    cursor: not-allowed;
    transform: none;
}

.convert-btn:disabled:hover {
    transform: none;
    box-shadow: none;
}

.convert-btn.success {
    background: var(--success);
}

.convert-btn.loading {
    position: relative;
    color: transparent;
}

.convert-btn.loading::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 24px;
    top: 50%;
    left: 50%;
    margin-left: -12px;
    margin-top: -12px;
    border: 3px solid transparent;
    border-top: 3px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Alert Messages */
.alert {
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    border-left: 4px solid;
    display: none;
}

.alert.active {
    display: block;
    animation: fadeIn 0.6s ease-out;
}

.alert-success {
    background: #f0f9f4;
    border-left-color: var(--success);
    color: #0f5132;
}

.alert-error {
    background: #fef0f0;
    border-left-color: var(--danger);
    color: #721c24;
}

.alert-warning {
    background: #fffbf0;
    border-left-color: var(--warning);
    color: #856404;
}

.alert-info {
    background: #f0f8ff;
    border-left-color: var(--accent);
    color: #055160;
}

/* ==========================================================================
   Footer Styles
   ========================================================================== */

.site-footer {
    background: var(--dark);
    color: white;
    padding: 60px 0 30px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-column h3 {
    color: var(--accent);
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
    font-weight: 600;
}

.footer-column p {
    color: #adb5bd;
    line-height: 1.6;
}

.footer-column ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-column ul li {
    margin-bottom: 0.8rem;
}

.footer-column ul li a {
    color: #adb5bd;
    text-decoration: none;
    transition: var(--transition);
}

.footer-column ul li a:hover {
    color: white;
    padding-left: 5px;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.site-info {
    border-top: 1px solid #495057;
    padding-top: 30px;
    text-align: center;
}

.copyright {
    color: #adb5bd;
    font-size: 0.9rem;
}

/* ==========================================================================
   Mobile Navigation
   ========================================================================== */

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: var(--transition);
}

.menu-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 1024px) {
    .tools-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 25px;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-wrap: wrap;
        gap: 15px;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .primary-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--secondary);
        flex-direction: column;
        padding: 1rem;
        box-shadow: var(--shadow);
        z-index: 1000;
    }
    
    .primary-menu.active {
        display: flex;
    }
    
    .primary-menu li {
        width: 100%;
    }
    
    .primary-menu li a {
        display: block;
        padding: 12px 20px;
        border-radius: 8px;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-description {
        font-size: 1.1rem;
    }
    
    .hero-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .hero-actions .btn {
        width: 200px;
    }
    
    .tools-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .converter-container {
        padding: 30px 20px;
        margin: 0 20px;
    }
    
    .upload-area {
        padding: 40px 20px;
    }
    
    .result-actions {
        flex-direction: column;
    }
    
    .result-actions .btn {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .hero {
        padding: 60px 0;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .tool-card {
        padding: 30px 20px;
    }
    
    .converter-header h1 {
        font-size: 2rem;
        flex-direction: column;
        gap: 10px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .auth-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .auth-buttons .btn {
        width: 100%;
        text-align: center;
    }
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mb-3 { margin-bottom: 3rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }

.p-0 { padding: 0; }
.p-1 { padding: 1rem; }
.p-2 { padding: 2rem; }
.p-3 { padding: 3rem; }

.d-none { display: none !important; }
.d-block { display: block !important; }
.d-flex { display: flex; }
.d-grid { display: grid; }

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.flex-column {
    flex-direction: column;
}

.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-muted { color: var(--gray); }

.bg-light { background: var(--light); }
.bg-white { background: white; }

.rounded { border-radius: var(--radius); }

/* Loading Animation */
@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(20px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .site-header,
    .site-footer,
    .hero-actions,
    .convert-btn,
    .menu-toggle {
        display: none !important;
    }
    
    .hero {
        background: white !important;
        color: black !important;
        padding: 2rem 0 !important;
    }
    
    .hero-title {
        color: black !important;
    }
    
    .converter-tools,
    .features {
        padding: 2rem 0 !important;
    }
    
    .tool-card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
}

/* ==========================================================================
   Dark Mode Support
   ========================================================================== */

@media (prefers-color-scheme: dark) {
    :root {
        --light: #1a1d23;
        --dark: #f8f9fa;
        --light-gray: #2d3239;
        --gray: #adb5bd;
    }
    
    body {
        background: #121417;
        color: var(--dark);
    }
    
    .tool-card,
    .converter-container {
        background: #1e2128;
        border-color: #2d3239;
    }
    
    .upload-area {
        background: #1a1d23;
        border-color: #2d3239;
    }
    
    .converter-tools {
        background: #121417;
    }
    
    .features {
        background: #1a1d23;
    }
}

/* ==========================================================================
   High Contrast Mode Support
   ========================================================================== */

@media (prefers-contrast: high) {
    :root {
        --shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
        --shadow-hover: 0 4px 8px rgba(0, 0, 0, 0.4);
    }
    
    .tool-card {
        border: 2px solid var(--dark);
    }
    
    .upload-area {
        border: 3px dashed var(--dark);
    }
}

/* ==========================================================================
   Reduced Motion Support
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .tool-card:hover,
    .btn:hover,
    .convert-btn:hover:not(:disabled) {
        transform: none;
    }
}