﻿/* White Colorful Theme */
:root {
    --bg-color: #ffffff;
    --pbg-color: #f0f0f0;
    --text-color: #333333;
    --card-bg: #ffffff;
    --border-color: #e0e0e0;
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --navbar-bg: #ffffff;
    --footer-bg: #f8f9fa;
    --dropzone-bg: #f8fafc;
    --dropzone-hover: #f1f5f9;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

body.dark-mode {
    --bg-color: #111827;
    --text-color: #f3f4f6;
    --card-bg: #1f2937;
    --border-color: #374151;
    --primary-color: #818cf8;
    --primary-hover: #6366f1;
    --navbar-bg: #1f2937;
    --footer-bg: #111827;
    --dropzone-bg: #1f2937;
    --dropzone-hover: #374151;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--pbg-color);
    color: var(--text-color);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    transition: background-color 0.3s, color 0.3s;
}

.navbar {
    background-color: var(--navbar-bg) !important;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    padding: 1rem 0;
}

.navbar-brand {
    font-weight: 700;
    color: var(--primary-color) !important;
    font-size: 1.5rem;
}

.nav-link {
    color: var(--text-color) !important;
    font-weight: 500;
    margin: 0 0.5rem;
    transition: color 0.2s;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color) !important;
}

.theme-toggle {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: 1rem;
}

.theme-toggle:hover {
    background-color: var(--dropzone-hover);
    color: var(--primary-color);
    transform: rotate(15deg);
}

/* ===== MEGA MENU STYLES ===== */
.mega-dropdown {
    position: static;
}

.mega-dropdown .dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    min-width: 600px;
    max-width: 1200px;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    padding: 0;
    margin-top: 0.5rem;
    z-index: 1050;
    background-color: var(--card-bg);
}

.mega-menu {
    padding: 2rem;
}

.mega-menu .container {
    max-width: 100%;
    padding: 0;
}

.mega-menu .row {
    margin: 0;
    align-items: flex-start;
}

.mega-menu .col-md-4,
.mega-menu .col-md-6 {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    display: flex;
    flex-direction: column;
}

.mega-menu-header {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1.25rem;
    padding-top: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--primary-color);
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.mega-menu-header:not(:first-child) {
    margin-top: 1.5rem;
}

.mega-menu-header i {
    font-size: 1rem;
}

.mega-menu .dropdown-item {
    padding: 0.75rem 1.25rem;
    border-radius: 10px;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    transition: all 0.3s ease;
    font-size: 0.95rem;
    font-weight: 500;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
}

.mega-menu .dropdown-item:hover {
    background: linear-gradient(135deg, var(--dropzone-hover) 0%, var(--card-bg) 100%);
    color: var(--primary-color);
    transform: translateX(8px);
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.1);
}

.mega-menu .dropdown-item i {
    width: 24px;
    opacity: 0.8;
    transition: all 0.3s ease;
}

.mega-menu .dropdown-item:hover i {
    opacity: 1;
    transform: scale(1.1);
}

/* Dark mode mega menu */
body.dark-mode .mega-menu {
    background-color: var(--card-bg);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.7);
}

body.dark-mode .mega-menu .dropdown-item:hover {
    background: linear-gradient(135deg, var(--dropzone-hover) 0%, var(--card-bg) 100%);
    box-shadow: 0 4px 12px rgba(129, 140, 248, 0.2);
}

/* Responsive */
@media (max-width: 768px) {
    .mega-menu .container {
        padding: 0 1rem;
    }

    .mega-menu .col-md-4,
    .mega-menu .col-md-6 {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        margin-bottom: 1.5rem;
        padding-bottom: 1.5rem;
    }

    .mega-menu .col-md-4:last-child,
    .mega-menu .col-md-6:last-child {
        border-bottom: none;
    }

    .mega-menu .dropdown-item {
        padding: 0.6rem 1rem;
    }
}

.mega-menu-promo {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.promo-card {
    background: linear-gradient(135deg, var(--primary-color) 0%, #8b5cf6 100%);
    padding: 2rem;
    border-radius: 16px;
    text-align: center;
    color: white;
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.3);
}

.promo-card h5 {
    color: white;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.promo-card p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.promo-card .btn {
    background-color: white;
    color: var(--primary-color);
    font-weight: 600;
    border: none;
    padding: 0.5rem 1.5rem;
}

.promo-card .btn:hover {
    background-color: rgba(255, 255, 255, 0.9);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

body.dark-mode .promo-card {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
}

.tool-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    transition: all 0.3s ease;
    height: 100%;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.icon-wrapper {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    transition: transform 0.3s;
}

.tool-card:hover .icon-wrapper {
    transform: scale(1.1);
}

.tool-icon {
    font-size: 1.75rem;
}

.card-title {
    color: var(--text-color);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.card-text {
    color: var(--text-color);
    opacity: 0.7;
    font-size: 0.95rem;
}

.file-drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: 16px;
    padding: 4rem 2rem;
    text-align: center;
    background-color: var(--dropzone-bg);
    transition: all 0.2s;
    cursor: pointer;
}

.file-drop-zone:hover,
.file-drop-zone.dragover {
    border-color: var(--primary-color);
    background-color: var(--dropzone-hover);
}

.file-drop-zone h4 {
    color: var(--text-color);
    font-weight: 600;
}

.btn-primary {
    background-color: var(--primary-color);
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    box-shadow: 0 4px 6px -1px rgba(99, 102, 241, 0.3);
    transition: all 0.2s;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 8px -1px rgba(99, 102, 241, 0.4);
}

.btn-danger {
    background-color: #ef4444;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
}

.pdf-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 24px;
}

.pdf-page-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0;
    position: relative;
    cursor: grab;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 260px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
}

.pdf-page-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.pdf-page-card canvas {
    max-width: 90%;
    height: auto;
    display: block;
    margin: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    pointer-events: none;
}

.page-number {
    width: 100%;
    text-align: center;
    background-color: var(--dropzone-bg);
    color: var(--text-color);
    padding: 8px 0;
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: auto;
    border-top: 1px solid var(--border-color);
}

.card-action-btn {
    position: absolute;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

.card-action-btn:hover {
    transform: scale(1.1);
}

.action-delete {
    top: 10px;
    right: 10px;
    background-color: #ef4444;
}

.action-rotate {
    top: 10px;
    left: 10px;
    background-color: #3b82f6;
}

footer {
    background-color: var(--footer-bg) !important;
    border-top: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.ad-container {
    width: 100%;
    min-height: 120px;
    background-color: var(--dropzone-bg);
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    opacity: 0.5;
    margin: 30px 0;
    text-transform: uppercase;
    font-weight: 600;
    font-size: 0.8rem;
    letter-spacing: 1px;
}

.pdf-page-card.selected {
    border: 2px solid #ef4444 !important;
    background-color: rgba(239, 68, 68, 0.1);
}

.pdf-page-card.selected .page-number {
    background-color: #ef4444;
    color: #fff;
}

@media (max-width: 768px) {
    .mega-menu .container {
        padding: 0 1rem;
    }

    .mega-menu .col-md-4 {
        margin-bottom: 1.5rem;
    }

    .promo-card {
        margin-top: 1rem;
    }
}