/* ==========================================
   DOKIRA - Liquid Glass Modern UI
   ========================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

:root {
    --glass-bg: rgba(255, 255, 255, 0.06);
    --glass-border: rgba(255, 255, 255, 0.12);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    --glass-blur: blur(20px);
    --primary: #00E676;
    --primary-light: #69F0AE;
    --primary-dark: #00C853;
    --secondary: #00E5FF;
    --accent: #76FF03;
    --success: #00E676;
    --warning: #FFD740;
    --danger: #FF5252;
    --text-primary: #e8f5e9;
    --text-secondary: #a5d6a7;
    --text-light: rgba(255,255,255,0.9);
    --radius: 16px;
    --radius-sm: 10px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --spring: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    --sidebar-width: 270px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    background: #0a0a1a;
    color: var(--text-primary);
    position: relative;
}

/* ==========================================
   ANIMATED BACKGROUND
   ========================================== */

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(0, 230, 118, 0.1) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 20%, rgba(0, 229, 255, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(118, 255, 3, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(0, 200, 83, 0.08) 0%, transparent 50%);
    z-index: -1;
    animation: ambientShift 20s ease-in-out infinite alternate;
}

@keyframes ambientShift {
    0% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.05) rotate(1deg); }
    100% { transform: scale(1) rotate(-1deg); }
}

/* Floating glass orbs */
.orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.3;
    z-index: -1;
    pointer-events: none;
    animation: orbFloat 20s ease-in-out infinite alternate;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: var(--primary);
    top: -100px;
    left: -100px;
    animation-duration: 25s;
}

.orb-2 {
    width: 350px;
    height: 350px;
    background: var(--secondary);
    bottom: -80px;
    right: -80px;
    animation-duration: 20s;
    animation-delay: -5s;
}

.orb-3 {
    width: 250px;
    height: 250px;
    background: var(--accent);
    top: 50%;
    left: 50%;
    animation-duration: 30s;
    animation-delay: -10s;
}

@keyframes orbFloat {
    0% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(50px, -30px) scale(1.1); }
    50% { transform: translate(-20px, 40px) scale(0.9); }
    75% { transform: translate(30px, 20px) scale(1.05); }
    100% { transform: translate(-40px, -20px) scale(1); }
}

/* ==========================================
   NAVBAR - Glass
   ========================================== */

.navbar {
    position: fixed;
    top: 20px;
    left: 20px;
    right: 20px;
    height: 64px;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--glass-shadow);
    display: flex;
    align-items: center;
    padding: 0 28px;
    z-index: 100;
    animation: navbarSlideIn 0.8s ease-out;
}

@keyframes navbarSlideIn {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 24px;
    font-weight: 800;
    color: white;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 10px rgba(0, 230, 118, 0.3);
}

.nav-logo {
    width: 36px;
    height: 36px;
    display: block;
}

.nav-brand i {
    font-size: 30px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    gap: 8px;
}

.nav-links a {
    text-decoration: none;
    color: rgba(255,255,255,0.6);
    font-weight: 500;
    font-size: 14px;
    padding: 8px 20px;
    border-radius: 100px;
    transition: var(--transition);
    position: relative;
}

.nav-links a:hover,
.nav-links a.active {
    color: white;
    background: rgba(255,255,255,0.1);
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    font-size: 22px;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 8px;
    transition: var(--transition);
}

.mobile-menu-btn:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

/* Sidebar Overlay for Mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 49;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.sidebar-overlay.active {
    display: block;
    animation: overlayFadeIn 0.3s ease;
}

@keyframes overlayFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ==========================================
   APP LAYOUT
   ========================================== */

.app-container {
    display: flex;
    margin-top: 100px;
    min-height: calc(100vh - 100px);
    padding: 0 20px 20px;
    gap: 20px;
}

/* ==========================================
   SIDEBAR - Glass
   ========================================== */

.sidebar {
    width: var(--sidebar-width);
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--glass-shadow);
    position: fixed;
    top: 100px;
    left: 20px;
    bottom: 20px;
    overflow-y: auto;
    z-index: 50;
    padding: 12px;
    animation: sidebarSlideIn 0.8s ease-out 0.2s both;
}

@keyframes sidebarSlideIn {
    from { transform: translateX(-30px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 10px;
}

.sidebar-header {
    padding: 16px 16px 12px;
}

.sidebar-header h3 {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255,255,255,0.4);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tool-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    color: rgba(255,255,255,0.65);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.tool-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 230, 118, 0.15), rgba(0, 229, 255, 0.05));
    border-radius: var(--radius-sm);
    opacity: 0;
    transition: var(--transition);
}

.tool-item i {
    width: 20px;
    text-align: center;
    font-size: 16px;
    color: rgba(255,255,255,0.4);
    transition: var(--transition);
    position: relative;
    z-index: 1;
}

.tool-item span {
    position: relative;
    z-index: 1;
}

.tool-item:hover {
    color: white;
    transform: translateX(4px);
}

.tool-item:hover::before {
    opacity: 1;
}

.tool-item:hover i {
    color: var(--primary-light);
}

.tool-item.active {
    color: white;
    background: rgba(0, 230, 118, 0.25);
    box-shadow: 0 4px 15px rgba(0, 230, 118, 0.2);
}

.tool-item.active i {
    color: var(--primary-light);
    text-shadow: 0 0 20px rgba(0, 230, 118, 0.5);
}

.tool-item.active::after {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 28px;
    background: linear-gradient(180deg, var(--primary), var(--secondary));
    border-radius: 0 3px 3px 0;
    box-shadow: 0 0 15px rgba(0, 230, 118, 0.6);
}

.sidebar-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    margin: 8px 16px;
}

/* ==========================================
   SIDEBAR SEARCH
   ========================================== */

.sidebar-search {
    position: relative;
    display: flex;
    align-items: center;
}

.sidebar-search i {
    position: absolute;
    left: 14px;
    font-size: 14px;
    color: rgba(255,255,255,0.3);
    pointer-events: none;
    transition: var(--transition);
}

.sidebar-search input {
    width: 100%;
    padding: 10px 14px 10px 38px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: inherit;
    color: rgba(255,255,255,0.8);
    outline: none;
    transition: var(--transition);
}

.sidebar-search input:focus {
    border-color: var(--primary);
    background: rgba(0, 230, 118, 0.08);
    box-shadow: 0 0 0 3px rgba(0, 230, 118, 0.1);
}

.sidebar-search input:focus + i,
.sidebar-search input:focus ~ i {
    color: var(--primary-light);
}

.sidebar-search input::placeholder {
    color: rgba(255,255,255,0.25);
}

/* ==========================================
   SIDEBAR CATEGORIES
   ========================================== */

.sidebar-category {
    margin-bottom: 4px;
}

.category-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    color: rgba(255,255,255,0.5);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    transition: var(--transition);
    user-select: none;
}

.category-header:hover {
    color: rgba(255,255,255,0.75);
    background: rgba(255,255,255,0.05);
}

.category-header i:first-child {
    font-size: 12px;
    width: 16px;
    text-align: center;
    color: rgba(255,255,255,0.3);
    transition: var(--transition);
}

.category-header:hover i:first-child {
    color: var(--primary-light);
}

.category-arrow {
    margin-left: auto;
    font-size: 10px !important;
    width: auto !important;
    color: rgba(255,255,255,0.25) !important;
    transition: transform 0.3s ease, color 0.3s ease !important;
}

.category-header.open .category-arrow {
    transform: rotate(180deg);
    color: var(--primary-light) !important;
}

.category-body {
    overflow: hidden;
    max-height: 500px;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease, margin 0.3s ease;
    opacity: 1;
}

.category-body.collapsed {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
    margin-bottom: 0;
    pointer-events: none;
}

.category-body .tool-item {
    padding-left: 28px;
    margin: 1px 0;
    border-radius: 8px;
}

.category-body .tool-item i {
    font-size: 14px;
    width: 18px;
}

/* ==========================================
   TOOL FILTER HIDING
   ========================================== */

.tool-item.hidden-by-filter {
    display: none !important;
}

.category-body.hidden-by-filter {
    max-height: 500px !important;
    opacity: 1 !important;
    pointer-events: all !important;
}

.sidebar-category.hidden-by-filter {
    display: none !important;
}

/* ==========================================
   MAIN CONTENT
   ========================================== */

.main-content {
    flex: 1;
    margin-left: calc(var(--sidebar-width) + 20px);
    padding: 16px 24px;
    max-width: calc(100vw - var(--sidebar-width) - 80px);
    animation: contentFadeIn 0.8s ease-out 0.4s both;
}

@keyframes contentFadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================
   WELCOME PAGE
   ========================================== */

.welcome-container {
    max-width: 1000px;
    margin: 0 auto;
    text-align: center;
    padding-top: 40px;
}

.welcome-icon {
    width: 120px;
    height: 120px;
    margin: 0 auto 32px;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 40px rgba(0, 230, 118, 0.2);
    animation: floatIcon 6s ease-in-out infinite;
    padding: 12px;
}

.welcome-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

@keyframes floatIcon {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

.welcome-icon i {
    font-size: 44px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.welcome-container h1 {
    font-size: 48px;
    font-weight: 800;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #ffffff 30%, var(--primary-light) 70%, var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -1px;
    line-height: 1.1;
}

.welcome-container > p {
    color: rgba(255,255,255,0.5);
    font-size: 18px;
    margin-bottom: 48px;
    font-weight: 400;
}

.welcome-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.welcome-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 28px 20px;
    transition: var(--spring);
    cursor: pointer;
    text-align: center;
    animation: cardReveal 0.6s ease-out both;
    position: relative;
    overflow: hidden;
}

.welcome-card:nth-child(1) { animation-delay: 0.1s; }
.welcome-card:nth-child(2) { animation-delay: 0.2s; }
.welcome-card:nth-child(3) { animation-delay: 0.3s; }
.welcome-card:nth-child(4) { animation-delay: 0.4s; }
.welcome-card:nth-child(5) { animation-delay: 0.5s; }
.welcome-card:nth-child(6) { animation-delay: 0.6s; }

@keyframes cardReveal {
    from { opacity: 0; transform: translateY(30px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.welcome-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 230, 118, 0.1), transparent);
    opacity: 0;
    transition: var(--transition);
    border-radius: var(--radius);
}

.welcome-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: rgba(0, 230, 118, 0.5);
    box-shadow: 0 20px 60px rgba(0, 230, 118, 0.2);
}

.welcome-card:hover::before {
    opacity: 1;
}

.welcome-card i {
    font-size: 36px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 14px;
    position: relative;
    z-index: 1;
}

.welcome-card h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
    color: rgba(255,255,255,0.9);
    position: relative;
    z-index: 1;
}

.welcome-card p {
    font-size: 13px;
    color: rgba(255,255,255,0.45);
    position: relative;
    z-index: 1;
}

/* ==========================================
   TOOL PANELS - Glass
   ========================================== */

.tool-panel {
    display: none;
    animation: panelFadeIn 0.5s ease;
}

.tool-panel.active {
    display: block;
}

@keyframes panelFadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.tool-header {
    margin-bottom: 28px;
}

.tool-header h2 {
    font-size: 30px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 14px;
    color: white;
}

.tool-header h2 i {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 32px;
}

.tool-header p {
    color: rgba(255,255,255,0.45);
    margin-top: 8px;
    font-size: 15px;
}

.tool-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 36px;
    box-shadow: var(--glass-shadow);
    max-width: 760px;
}

/* ==========================================
   DROP ZONE - Glass
   ========================================== */

.drop-zone {
    border: 2px dashed rgba(255,255,255,0.15);
    border-radius: var(--radius);
    padding: 56px 24px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    background: rgba(255,255,255,0.03);
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: var(--primary);
    background: rgba(0, 230, 118, 0.08);
    transform: scale(1.01);
}

.drop-zone i {
    font-size: 56px;
    color: rgba(255,255,255,0.2);
    margin-bottom: 16px;
    transition: var(--transition);
}

.drop-zone:hover i,
.drop-zone.drag-over i {
    color: var(--primary-light);
    transform: translateY(-4px);
}

.drop-zone h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
    color: rgba(255,255,255,0.8);
}

.drop-zone p {
    color: rgba(255,255,255,0.4);
    font-size: 14px;
}

.drop-zone input[type="file"] {
    display: none;
}

.drop-zone .browse-btn {
    display: inline-block;
    margin-top: 20px;
    padding: 12px 32px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border-radius: 100px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    box-shadow: 0 4px 20px rgba(0, 230, 118, 0.3);
}

.drop-zone .browse-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 230, 118, 0.4);
}

/* ==========================================
   FILE LIST
   ========================================== */

.file-list {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: rgba(255,255,255,0.05);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255,255,255,0.08);
    transition: var(--transition);
    animation: fileItemIn 0.3s ease;
}

@keyframes fileItemIn {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

.file-item:hover {
    border-color: rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.08);
    transform: translateX(4px);
}

.file-item i {
    font-size: 28px;
    color: var(--danger);
    text-shadow: 0 2px 10px rgba(255, 82, 82, 0.3);
}

.file-item .file-info {
    flex: 1;
}

.file-item .file-info .file-name {
    font-weight: 500;
    font-size: 14px;
    color: rgba(255,255,255,0.85);
}

.file-item .file-info .file-size {
    font-size: 12px;
    color: rgba(255,255,255,0.35);
}

.file-item .file-remove {
    background: none;
    border: none;
    color: rgba(255,255,255,0.3);
    cursor: pointer;
    font-size: 18px;
    padding: 4px 8px;
    border-radius: 6px;
    transition: var(--transition);
}

.file-item .file-remove:hover {
    color: var(--danger);
    background: rgba(255, 82, 82, 0.15);
}

/* ==========================================
   BUTTONS - Glass
   ========================================== */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 32px;
    border: none;
    border-radius: 100px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--spring);
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 100px;
    background: linear-gradient(135deg, rgba(255,255,255,0.1), transparent);
    opacity: 0;
    transition: var(--transition);
}

.btn:hover::after {
    opacity: 1;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 20px rgba(0, 230, 118, 0.35);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 35px rgba(0, 230, 118, 0.5);
}

.btn-primary:active {
    transform: translateY(-1px);
}

.btn-primary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.btn-secondary {
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.8);
    border: 1px solid rgba(255,255,255,0.12);
}

.btn-secondary:hover {
    background: rgba(255,255,255,0.14);
    color: white;
    transform: translateY(-2px);
}

.btn-success {
    background: linear-gradient(135deg, var(--success), #00C853);
    color: white;
    box-shadow: 0 4px 20px rgba(0, 230, 118, 0.3);
}

.btn-success:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 230, 118, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #D32F2F);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(255, 82, 82, 0.4);
}

.btn-sm {
    padding: 8px 18px;
    font-size: 13px;
}

.btn-lg {
    padding: 16px 40px;
    font-size: 16px;
}

.actions {
    margin-top: 24px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* ==========================================
   FORM CONTROLS - Glass
   ========================================== */

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: rgba(255,255,255,0.7);
    margin-bottom: 8px;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group select {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
    color: white;
    outline: none;
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--primary);
    background: rgba(0, 230, 118, 0.08);
    box-shadow: 0 0 0 4px rgba(0, 230, 118, 0.1);
}

.form-group input::placeholder {
    color: rgba(255,255,255,0.25);
}

.form-group select option {
    background: #1a1a2e;
    color: white;
}

/* ==========================================
   RANGE INPUT
   ========================================== */

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 230, 118, 0.4);
}

/* ==========================================
   PAGE PREVIEW - Glass
   ========================================== */

.pages-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
}

.page-thumb {
    width: 120px;
    height: 160px;
    background: rgba(255,255,255,0.05);
    border: 2px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    position: relative;
    transition: var(--spring);
}

.page-thumb:hover {
    border-color: var(--primary);
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 40px rgba(0, 230, 118, 0.25);
}

.page-thumb.selected {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 230, 118, 0.3), 0 8px 30px rgba(0, 230, 118, 0.2);
}

.page-thumb canvas {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.page-thumb .page-number {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: rgba(255,255,255,0.9);
    text-align: center;
    font-size: 12px;
    padding: 8px 4px 6px;
    font-weight: 500;
}

.page-thumb .page-checkbox {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 2;
}

.page-thumb .page-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

/* ==========================================
   TOAST - Glass
   ========================================== */

.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 16px 24px;
    border-radius: var(--radius-sm);
    color: white;
    font-size: 14px;
    font-weight: 500;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: toastSlideIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    min-width: 320px;
}

.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.info { border-left: 3px solid var(--secondary); }
.toast.warning { border-left: 3px solid var(--warning); }

@keyframes toastSlideIn {
    from { transform: translateX(100%) scale(0.8); opacity: 0; }
    to { transform: translateX(0) scale(1); opacity: 1; }
}

/* ==========================================
   LOADER - Glass
   ========================================== */

.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

.loader-overlay.active {
    display: flex;
    animation: overlayIn 0.3s ease;
}

@keyframes overlayIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.loader {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 48px 56px;
    text-align: center;
    box-shadow: var(--glass-shadow);
    animation: loaderPop 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes loaderPop {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.loader-spinner {
    width: 52px;
    height: 52px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top-color: var(--primary);
    border-right-color: var(--secondary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loader p {
    color: rgba(255,255,255,0.7);
    font-weight: 500;
    font-size: 16px;
}

/* ==========================================
   TOOL OPTIONS
   ========================================== */

.tool-options {
    margin-top: 24px;
    padding: 20px;
    background: rgba(255,255,255,0.03);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255,255,255,0.06);
}

/* ==========================================
   PASSWORD TOGGLE
   ========================================== */

.password-input-wrapper {
    position: relative;
}

.password-input-wrapper input {
    padding-right: 44px !important;
}

.password-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(255,255,255,0.35);
    cursor: pointer;
    font-size: 16px;
    transition: var(--transition);
}

.password-toggle:hover {
    color: rgba(255,255,255,0.6);
}

/* ==========================================
   PROGRESS BAR - Glass
   ========================================== */

.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255,255,255,0.08);
    border-radius: 10px;
    overflow: hidden;
    margin-top: 16px;
}

.progress-bar .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent));
    background-size: 200% 100%;
    border-radius: 10px;
    transition: width 0.4s ease;
    animation: shimmer 2s linear infinite;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ==========================================
   REARRANGE CONTROLS
   ========================================== */

.rearrange-controls {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

/* ==========================================
   MODALS (TTS, Search, Analytics, QR)
   ========================================== */

.tts-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: overlayIn 0.3s ease;
}

.tts-modal-content {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--glass-shadow);
    max-width: 500px;
    width: 90%;
    animation: loaderPop 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.tts-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.tts-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: white;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tts-header h3 i {
    color: var(--primary-light);
}

.tts-close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.4);
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: var(--transition);
}

.tts-close:hover {
    color: white;
    background: rgba(255,255,255,0.1);
}

.tts-body {
    padding: 24px;
}

.tts-visualizer {
    text-align: center;
    margin-bottom: 24px;
}

.tts-wave {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 40px;
    margin-bottom: 12px;
}

.tts-wave span {
    width: 4px;
    height: 20px;
    background: linear-gradient(180deg, var(--primary), var(--secondary));
    border-radius: 4px;
    animation: waveAnim 0.8s ease-in-out infinite alternate;
}

.tts-wave span:nth-child(2) { animation-delay: 0.1s; height: 30px; }
.tts-wave span:nth-child(3) { animation-delay: 0.2s; height: 40px; }
.tts-wave span:nth-child(4) { animation-delay: 0.3s; height: 30px; }
.tts-wave span:nth-child(5) { animation-delay: 0.4s; height: 20px; }

@keyframes waveAnim {
    from { transform: scaleY(0.5); }
    to { transform: scaleY(1); }
}

.tts-current-word {
    font-size: 18px;
    font-weight: 600;
    color: rgba(255,255,255,0.9);
    min-height: 28px;
}

.tts-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 20px;
}

.tts-speed {
    margin-bottom: 16px;
}

.tts-speed label {
    font-size: 13px;
    color: rgba(255,255,255,0.6);
    display: block;
    margin-bottom: 8px;
}

.tts-progress {
    margin-top: 8px;
}

/* Analytics Cards */
.analytics-card {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
}

.analytics-value {
    font-size: 28px;
    font-weight: 700;
    color: white;
    line-height: 1.2;
}

.analytics-label {
    font-size: 12px;
    color: rgba(255,255,255,0.4);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ==========================================
   FOOTER
   ========================================== */

.app-footer {
    text-align: center;
    padding: 20px 24px 24px;
    margin-top: 20px;
    position: relative;
    z-index: 1;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
}

.footer-content p {
    font-size: 13px;
    color: rgba(255,255,255,0.35);
    font-weight: 500;
    letter-spacing: 0.3px;
}

.footer-content a {
    color: rgba(255,255,255,0.55);
    text-decoration: none;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.footer-content a:hover {
    color: var(--primary-light);
    text-shadow: 0 0 20px rgba(0, 230, 118, 0.3);
}

.footer-content a i {
    font-size: 12px;
}

/* ==========================================
   NAVBAR CREDIT
   ========================================== */

.nav-credit {
    display: flex;
    align-items: center;
}

.nav-credit a {
    text-decoration: none;
    color: rgba(255,255,255,0.5);
    font-weight: 500;
    font-size: 13px;
    padding: 6px 16px;
    border-radius: 100px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
}

.nav-credit a:hover {
    color: white;
    background: rgba(0, 230, 118, 0.15);
    border-color: rgba(0, 230, 118, 0.3);
    box-shadow: 0 4px 20px rgba(0, 230, 118, 0.2);
    transform: translateY(-1px);
}

.nav-credit a i {
    font-size: 12px;
    color: var(--primary-light);
}

/* ==========================================
   RESPONSIVE
   ========================================== */

@media (max-width: 1024px) {
    .welcome-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .navbar {
        top: 12px;
        left: 12px;
        right: 12px;
        padding: 0 16px;
    }

    .nav-credit {
        display: none;
    }

    .sidebar {
        transform: translateX(-110%);
        top: 88px;
        left: 12px;
        bottom: 12px;
        transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding: 16px;
        max-width: 100vw;
    }

    .welcome-grid {
        grid-template-columns: 1fr;
    }

    .tool-card {
        padding: 20px;
    }

    .welcome-container h1 {
        font-size: 32px;
    }

    .app-container {
        padding: 0 12px 12px;
    }
}
