/* 
    ShortConverter.com - Modern Premium Design System
    Palette: White, Off-white, Light Gray, and Soft Neutrals
*/

:root {
    --bg-light: #f9fafb;
    --bg-white: #ffffff;
    --border-color: #f1f5f9;
    --border-dark: #cbd5e1;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --accent-blue: #3b82f6;
    --accent-dark: #1e293b;
    
    --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.02);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.04), 0 2px 4px -2px rgba(0, 0, 0, 0.02);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.04), 0 4px 6px -4px rgba(0, 0, 0, 0.02);
    --shadow-premium: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.03);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

/* Base Styles */
body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    color: var(--accent-dark);
    letter-spacing: -0.025em;
}

/* Top Navigation Bar */
.navbar {
    background-color: var(--bg-white) !important;
    border-bottom: 1px solid var(--border-color);
    padding: 0.8rem 0;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-smooth);
}

.navbar-brand {
    font-weight: 800;
    color: var(--text-primary) !important;
    font-size: 1.25rem;
}

.navbar-nav {
    gap: 1.5rem;
    align-items: center;
}

.nav-link {
    font-weight: 500;
    color: var(--text-secondary) !important;
    padding: 0.4rem 0 !important;
    position: relative;
    transition: var(--transition-fast);
}

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

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent-blue);
    transition: var(--transition-fast);
    border-radius: 2px;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.dropdown-toggle::after {
    border-top: 0.3em solid var(--text-secondary) !important;
    vertical-align: middle;
}

/* Enhanced Mega Menu */
.mega-menu {
    position: static !important;
}

.mega-menu .dropdown-menu {
    width: 100%;
    left: 0;
    right: 0;
    padding: 2rem 0;
    border: 1px solid var(--border-color);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    box-shadow: var(--shadow-premium);
    background: var(--bg-white);
    margin-top: 0;
}

.mega-menu .dropdown-header {
    color: var(--accent-blue);
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 0 1rem 0.75rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mega-menu .dropdown-header::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, var(--border-color), transparent);
}

.mega-menu .dropdown-item {
    font-weight: 500;
    color: var(--text-secondary);
    padding: 0.6rem 1rem;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
    font-size: 0.9rem;
}

.mega-menu .dropdown-item:hover {
    background-color: var(--bg-light);
    color: var(--text-primary);
    transform: translateX(4px);
}

/* Hero Section */
.hero-section {
    padding: 80px 0;
    background-color: var(--bg-light);
    border-bottom: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.hero-section h1 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-size: clamp(2rem, 4.5vw, 3rem);
}

.hero-section p {
    font-size: clamp(1rem, 2vw, 1.15rem);
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.shape {
    position: absolute;
    background: rgba(0, 0, 0, 0.015);
    border-radius: 50%;
    z-index: 1;
}

.shape-1 {
    width: 250px;
    height: 250px;
    top: -80px;
    right: -40px;
}

.shape-2 {
    width: 180px;
    height: 180px;
    bottom: -40px;
    left: -40px;
}

.hero-content {
    position: relative;
    z-index: 2;
}

/* Search Bar System */
.search-wrapper {
    max-width: 550px;
    margin: 0 auto;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 16px 24px;
    border-radius: 100px;
    border: 1px solid var(--border-dark);
    background: var(--bg-white);
    box-shadow: var(--shadow-md);
    font-size: 1rem;
    color: var(--text-primary);
    transition: var(--transition-smooth);
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-input:focus {
    background: var(--bg-white);
    border-color: var(--accent-blue);
    outline: none;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.search-btn {
    position: absolute;
    right: 6px;
    top: 6px;
    bottom: 6px;
    border-radius: 50px;
    padding: 0 24px;
    background-color: var(--accent-dark);
    border: none;
    color: var(--bg-white);
    font-weight: 600;
    transition: var(--transition-fast);
}

.search-btn:hover {
    background-color: var(--text-primary);
}

/* Tool Cards */
.category-title {
    margin: 50px 0 25px;
    position: relative;
    display: inline-block;
    padding-bottom: 10px;
    font-size: 1.5rem;
    font-weight: 700;
}

.category-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background: var(--accent-blue);
    border-radius: 2px;
}

.tool-card {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    padding: 1.5rem 1rem;
    text-align: center;
    transition: var(--transition-smooth);
    border: 1px solid var(--border-color);
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none !important;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.tool-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-dark);
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--accent-blue);
    transform: scaleX(0);
    transition: var(--transition-fast);
}

.tool-card:hover::before {
    transform: scaleX(1);
}

.tool-icon {
    width: 48px;
    height: 48px;
    background: var(--bg-light);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    color: var(--text-secondary);
    font-size: 1.4rem;
    transition: var(--transition-fast);
}

.tool-card:hover .tool-icon {
    background: var(--accent-dark);
    color: var(--bg-white);
    transform: rotate(3deg) scale(1.05);
}

.tool-card h5 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0;
    color: var(--text-primary);
    line-height: 1.4;
}

/* Tool Execution Container */
.tool-container {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
    margin-top: -40px;
    position: relative;
    border: 1px solid var(--border-color);
    z-index: 10;
}

/* Buttons */
.btn {
    border-radius: 50px;
    font-weight: 500;
    padding: 10px 24px;
    transition: var(--transition-fast);
}

.btn-primary {
    background-color: var(--accent-dark) !important;
    border-color: var(--accent-dark) !important;
    color: var(--bg-white) !important;
}

.btn-primary:hover {
    background-color: var(--text-primary) !important;
    border-color: var(--text-primary) !important;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline-primary {
    color: var(--accent-dark) !important;
    border-color: var(--border-dark) !important;
}

.btn-outline-primary:hover {
    background-color: var(--bg-light) !important;
    color: var(--text-primary) !important;
    border-color: var(--accent-dark) !important;
}

/* Footer Section */
footer {
    background-color: var(--bg-white);
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
    padding: 60px 0 30px;
}

footer h4, footer h5 {
    color: var(--text-primary);
    margin-bottom: 1.25rem;
}

footer .footer-link {
    color: var(--text-muted);
    text-decoration: none;
    display: block;
    margin-bottom: 0.75rem;
    transition: var(--transition-fast);
    font-size: 0.95rem;
}

footer .footer-link:hover {
    color: var(--text-primary);
    padding-left: 4px;
}

/* Upload Area */
.upload-area {
    background: var(--bg-light);
    border: 2px dashed var(--border-dark);
    border-radius: var(--radius-md);
    padding: 4rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.upload-area:hover {
    border-color: var(--accent-blue);
    background: #f8fafc;
}

/* Scroll To Top Button */
.scroll-top {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 44px;
    height: 44px;
    background: var(--accent-dark);
    color: var(--bg-white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: var(--shadow-md);
    z-index: 1000;
    transition: var(--transition-fast);
}

.scroll-top:hover {
    background-color: var(--text-primary);
    transform: translateY(-2px);
}

/* -------------------------------------------------------------
   ADMIN PANEL LAYOUT (Sidebar & Core Dashboard)
   ------------------------------------------------------------- */
.admin-wrapper {
    display: flex;
    width: 100%;
    align-items: stretch;
    min-height: 100vh;
}

#sidebar {
    min-width: 260px;
    max-width: 260px;
    background: var(--bg-white);
    color: var(--text-primary);
    border-right: 1px solid var(--border-color);
    transition: var(--transition-smooth);
    z-index: 99;
}

#sidebar.active {
    margin-left: -260px;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-menu {
    padding: 20px 0;
    list-style: none;
    margin: 0;
}

.sidebar-menu li a {
    padding: 12px 25px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition-fast);
    font-size: 0.95rem;
}

.sidebar-menu li a:hover,
.sidebar-menu li.active a {
    color: var(--text-primary);
    background: var(--bg-light);
    border-left: 4px solid var(--accent-blue);
    padding-left: 21px;
}

.admin-content-area {
    width: 100%;
    min-height: 100vh;
    transition: var(--transition-smooth);
}

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

.admin-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: var(--transition-smooth);
}

.admin-card:hover {
    box-shadow: var(--shadow-md);
}

/* Statistics Widgets */
.stat-widget-card {
    padding: 24px;
    border-radius: var(--radius-md);
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.stat-widget-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--accent-blue);
}

/* DataTables Styling Overhaul */
.dataTables_wrapper .dataTables_filter {
    float: right;
    margin-bottom: 1.5rem;
}

.dataTables_wrapper .dataTables_filter input {
    border-radius: 50px;
    padding: 8px 18px;
    border: 1px solid var(--border-dark);
    width: 250px !important;
    font-size: 0.9rem;
    transition: var(--transition-fast);
}

.dataTables_wrapper .dataTables_filter input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.08);
}

.dataTables_wrapper .dataTables_paginate {
    float: right;
    margin-top: 1.5rem;
}

.dataTables_wrapper .dataTables_info {
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.pagination .page-link {
    border-radius: 50px !important;
    margin: 0 3px;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 8px 16px;
    transition: var(--transition-fast);
}

.pagination .page-link:hover {
    background-color: var(--bg-light);
    color: var(--text-primary);
}

.pagination .active .page-link {
    background-color: var(--accent-dark) !important;
    border-color: var(--accent-dark) !important;
    color: var(--bg-white) !important;
}

/* Table layout styling */
table.table {
    border-collapse: separate;
    border-spacing: 0 8px;
}

table.table tbody tr {
    background-color: var(--bg-white);
    box-shadow: var(--shadow-sm);
    transition: var(--transition-fast);
}

table.table tbody tr:hover {
    background-color: #fafbfc !important;
}

table.table td, table.table th {
    padding: 16px !important;
    border: none;
}

table.table td:first-child, table.table th:first-child {
    border-top-left-radius: var(--radius-md);
    border-bottom-left-radius: var(--radius-md);
}

table.table td:last-child, table.table th:last-child {
    border-top-right-radius: var(--radius-md);
    border-bottom-right-radius: var(--radius-md);
}

/* Toast container */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

/* -------------------------------------------------------------
   RESPONSIVE DESIGN ADAPTATIONS
   ------------------------------------------------------------- */
@media (max-width: 991px) {
    #sidebar {
        margin-left: -260px;
        position: fixed;
        height: 100vh;
    }
    
    #sidebar.active {
        margin-left: 0;
    }
    
    .navbar-collapse {
        background: var(--bg-white);
        margin: 0 -12px;
        padding: 1.5rem;
        border-radius: 0 0 var(--radius-lg) var(--radius-lg);
        box-shadow: var(--shadow-lg);
        border: 1px solid var(--border-color);
        max-height: 80vh;
        overflow-y: auto;
    }
    
    .navbar-nav {
        gap: 0.75rem;
        align-items: stretch;
    }
    
    .nav-link {
        color: var(--text-primary) !important;
        padding: 0.6rem 0 !important;
        border-bottom: 1px solid var(--border-color);
    }
    
    /* Scrollable Mega Dropdown for Mobile */
    .mega-menu .dropdown-menu {
        max-height: 350px;
        overflow-y: auto !important;
        padding: 1rem !important;
    }
    
    .mega-menu .dropdown-menu::-webkit-scrollbar {
        width: 4px;
    }
    .mega-menu .dropdown-menu::-webkit-scrollbar-track {
        background: transparent;
    }
    .mega-menu .dropdown-menu::-webkit-scrollbar-thumb {
        background: #cbd5e1;
        border-radius: 4px;
    }
    .mega-menu .dropdown-menu::-webkit-scrollbar-thumb:hover {
        background: #94a3b8;
    }
    
    /* Disable column scrolling on mobile to prevent nested scrollbars */
    .mega-menu-column {
        max-height: none !important;
        overflow-y: visible !important;
        padding-right: 0 !important;
    }
    
    .tool-container {
        padding: 1.75rem;
        margin-top: -30px;
    }
}

@media (max-width: 767px) {
    .hero-section {
        padding: 50px 0;
    }
    
    .search-input {
        padding: 14px 20px;
        font-size: 0.95rem;
    }
    
    .search-btn {
        position: relative;
        width: 100%;
        margin-top: 10px;
        right: 0;
        top: 0;
        padding: 14px;
        border-radius: 50px;
    }
    
    .tool-card {
        padding: 1rem 0.5rem;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
        display: flex;
    }
    
    .d-flex.gap-3 {
        flex-direction: column !important;
        gap: 0.5rem !important;
    }
}

/* Admin Footer Styling */
.admin-footer {
    border-top: 1px solid var(--border-color);
    background: var(--bg-white);
    padding: 1.25rem 0;
    width: 100%;
}

/* Mega Dropdown Scrollable Columns on Desktop */
@media (min-width: 992px) {
    .mega-menu-column {
        max-height: 350px;
        overflow-y: auto;
        padding-right: 6px;
    }
    .mega-menu-column::-webkit-scrollbar {
        width: 4px;
    }
    .mega-menu-column::-webkit-scrollbar-track {
        background: transparent;
    }
    .mega-menu-column::-webkit-scrollbar-thumb {
        background: #cbd5e1;
        border-radius: 4px;
    }
    .mega-menu-column::-webkit-scrollbar-thumb:hover {
        background: #94a3b8;
    }
}