:root {
    --primary: #0f2b46;
    --primary-light: #1a3c5e;
    --accent: #c0962d;
    --secondary: #667eea;
    --text-main: #111111;
    --text-muted: #666666;
    --bg-light: #f5f5f7;
    --white: #ffffff;
    --border: #eeeeee;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

body {
    background-color: var(--white);
    color: var(--text-main);
    line-height: 1.6;
    padding-top: 60px; /* Navbar height */
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* ========== Solmates Navbar ========== */
.top-nav {
    position: fixed;
    top: 0;
    width: 100%;
    height: 60px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.nav-left {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-back-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 99px; /* Pill shape for Apple feel */
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(15, 43, 70, 0.1);
}

.nav-back-btn:hover {
    background: var(--primary-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(15, 43, 70, 0.15);
}

/* ========== Hero Section Style Header ========== */
.tool-header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 40px 20px;
    background: linear-gradient(to bottom, #ffffff, #f9f9fb);
    border-radius: 20px;
}

.tool-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1rem;
    letter-spacing: -0.5px;
}

.tool-header p {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 700px;
    margin: 0 auto;
}

/* ========== Interactive Cards ========== */
.upload-card {
    background: var(--white);
    border: 2px dashed var(--border);
    border-radius: 1.5rem;
    padding: 4rem 2rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    margin-bottom: 2rem;
    max-width: 100%;
    width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.upload-card:hover {
    border-color: var(--accent);
    background: #fffcf5;
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.upload-card i {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
    display: block;
}

.upload-card h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--primary);
}

#fileName {
    word-break: break-all !important;
    word-wrap: break-word !important;
    overflow-wrap: anywhere !important;
    white-space: normal !important;
    max-width: 100%;
    width: 100%;
    display: block;
}

/* ========== Buttons ========== */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--primary);
    color: white;
    padding: 1rem 2.5rem;
    border-radius: 12px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 20px rgba(15, 43, 70, 0.15);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(15, 43, 70, 0.25);
    background: var(--primary-light);
}

.btn-primary:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ========== Result Area ========== */
.result-area {
    margin-top: 3rem;
    padding: 2.5rem;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 1.5rem;
    display: none;
    animation: slideUp 0.5s ease-out;
    box-shadow: var(--shadow);
}

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

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    margin-bottom: 2rem;
    transition: color 0.3s;
}

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

/* Professional Loading State */
.loading-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    display: none;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

/* ========== Responsive Enhancements ========== */
canvas {
    max-width: 100% !important;
    height: auto !important;
}

.canvas-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    justify-content: center;
    background: #f0f0f2;
    padding: 10px;
    border-radius: 12px;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .container {
        padding: 20px 15px;
    }
    
    .tool-header {
        margin-bottom: 2rem;
        padding: 30px 15px;
    }
    
    .tool-header h1 {
        font-size: 1.8rem;
    }
    
    .tool-header p {
        font-size: 0.95rem;
    }
    
    .upload-card {
        padding: 3rem 1.5rem;
    }
    
    .btn-primary {
        width: 100%;
        justify-content: center;
        padding: 1rem;
    }
    
    .result-area {
        padding: 1.5rem;
    }
}

