/* Global Styles */
* { 
    scroll-behavior: smooth; 
}

/* Background Gradients */
.gradient-bg { 
    background: linear-gradient(135deg, #4158D0 0%, #C850C0 46%, #FFCC70 100%);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Enhanced header with animated glow */
.gradient-bg::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0) 70%);
    opacity: 0.6;
    animation: pulse 8s infinite linear;
    pointer-events: none; /* So it doesn't interfere with clicks */
    z-index: 1;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 0.6; }
    50% { transform: scale(1.05); opacity: 0.8; }
    100% { transform: scale(1); opacity: 0.6; }
}

/* Card Effects */
.card-hover { 
    transition: all 0.3s ease; 
}
.card-hover:hover { 
    transform: translateY(-5px); 
    box-shadow: 0 20px 40px rgba(0,0,0,0.1); 
}
.tool-card { 
    background: linear-gradient(145deg, #ffffff, #f8fafc); 
    border: 1px solid #e2e8f0; 
}

/* Drop Zones */
.drop-zone { 
    border: 2px dashed #cbd5e0; 
    transition: all 0.3s ease; 
}
.drop-zone.dragover { 
    border-color: #3b82f6; 
    background-color: #eff6ff; 
}

/* PDF Preview */
.preview-canvas { 
    max-width: 100%; 
    height: auto; 
    border: 1px solid #e2e8f0; 
    border-radius: 8px; 
}
.page-thumbnail { 
    width: 120px; 
    height: 150px; 
    object-fit: cover; 
    border-radius: 4px; 
    cursor: pointer; 
    transition: all 0.2s ease; 
}
.page-thumbnail:hover { 
    transform: scale(1.05); 
    box-shadow: 0 4px 12px rgba(0,0,0,0.15); 
}

/* UI Controls */
.slider { 
    -webkit-appearance: none; 
    appearance: none; 
    height: 4px; 
    border-radius: 2px; 
    background: #e2e8f0; 
    outline: none; 
}
.slider::-webkit-slider-thumb { 
    -webkit-appearance: none; 
    appearance: none; 
    width: 20px; 
    height: 20px; 
    border-radius: 50%; 
    background: #3b82f6; 
    cursor: pointer; 
}

/* Loading Indicator */
.loading-spinner { 
    border: 4px solid #f3f4f6; 
    border-top: 4px solid #3b82f6; 
    border-radius: 50%; 
    width: 40px; 
    height: 40px; 
    animation: spin 1s linear infinite; 
}
@keyframes spin { 
    0% { transform: rotate(0deg); } 
    100% { transform: rotate(360deg); } 
}

/* Navigation Menu Enhancements */
header nav {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 5px 8px;
    backdrop-filter: blur(10px);
    box-shadow: 
        0 4px 6px rgba(0, 0, 0, 0.05),
        inset 0 1px 1px rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

header nav a {
    position: relative;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 500;
    letter-spacing: 0.02em;
    transition: all 0.3s ease;
    z-index: 1;
}

header nav a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0);
    border-radius: inherit;
    z-index: -1;
    transition: all 0.3s ease;
    transform: scale(0.8);
    opacity: 0;
}

header nav a:hover::before,
header nav a.active::before {
    transform: scale(1);
    opacity: 1;
    background: rgba(255, 255, 255, 0.15);
}

header nav a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

header nav a:hover::after {
    width: 70%;
    opacity: 1;
}

header nav a.active {
    background-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

header nav a.active::after {
    width: 70%;
    opacity: 1;
}

/* Logo Enhancement */
header h1 {
    position: relative;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    letter-spacing: 0.03em;
}

header h1 i {
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.2));
    transition: transform 0.3s ease;
}

header h1:hover i {
    transform: rotate(-10deg) scale(1.1);
}

/* Enhanced Logo Styling */
.logo-icon {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.1), 
                0 4px 10px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.logo-icon i {
    font-size: 1.5rem;
    position: relative;
    z-index: 2;
    color: white;
}

.logo-icon::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0) 70%);
    top: -50%;
    left: -50%;
    opacity: 0;
    transition: all 0.5s ease;
}

header h1:hover .logo-icon {
    transform: scale(1.1) rotate(-10deg);
    box-shadow: 0 0 0 8px rgba(255, 255, 255, 0.2), 
                0 8px 20px rgba(0, 0, 0, 0.25);
}

header h1:hover .logo-icon::after {
    animation: shine 1.5s ease forwards;
}

.logo-text {
    background: linear-gradient(to right, #ffffff, #e0e0e0);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 700;
    letter-spacing: 0.03em;
    position: relative;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

header h1:hover .logo-text {
    transform: scale(1.03);
    background: linear-gradient(to right, #ffffff, #f0f0f0);
    -webkit-background-clip: text;
    background-clip: text;
}

@keyframes shine {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0);
    }
    50% {
        opacity: 0.8;
        transform: translate(0%, 0%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(50%, 50%) scale(0);
    }
}

/* Mobile Menu Animation */
#mobileMenu { 
    animation: slideDown 0.3s ease-out;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 0.5rem;
    margin-top: 1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

@keyframes slideDown { 
    from { opacity: 0; transform: translateY(-10px); } 
    to { opacity: 1; transform: translateY(0); } 
}

/* Mobile Menu Items */
#mobileMenu a {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

#mobileMenu a:last-child {
    border-bottom: none;
}

#mobileMenu a i {
    background: rgba(255, 255, 255, 0.15);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    transition: all 0.3s ease;
}

#mobileMenu a:hover i {
    transform: scale(1.2);
    background: rgba(255, 255, 255, 0.25);
}

#mobileMenu a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: rgba(255, 255, 255, 0);
    transition: all 0.3s ease;
}

#mobileMenu a:hover::before,
#mobileMenu a.active::before {
    background: rgba(255, 255, 255, 0.8);
}

#mobileMenu a.active {
    background: rgba(255, 255, 255, 0.15);
    font-weight: 600;
}

/* Enhanced Mobile Menu */
.mobile-menu-button {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    padding: 8px 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.mobile-menu-button:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

.mobile-menu-button:active {
    transform: translateY(1px);
}

.mobile-menu-container {
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 
        0 10px 15px -3px rgba(0, 0, 0, 0.1),
        0 4px 6px -2px rgba(0, 0, 0, 0.05);
}
