:root {
    --primary-color: #3b82f6; /* Modern Blue */
    --primary-hover: #2563eb;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --dark-bg: #1e293b;
    --light-bg: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --border-radius: 0.5rem;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

/* Global Reset & Typography */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--light-bg);
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
}

/* Layui Overrides - Hiding the "Layui Look" */

/* Buttons */
.layui-btn {
    border-radius: var(--border-radius);
    height: 38px;
    line-height: 38px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    border: none;
}

.layui-btn-primary {
    border: 1px solid var(--border-color);
    background-color: #fff;
    color: var(--text-main);
}

.layui-btn-primary:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.layui-btn-normal, .layui-bg-blue {
    background-color: var(--primary-color) !important;
}

.layui-btn-normal:hover, .layui-bg-blue:hover {
    background-color: var(--primary-hover) !important;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.layui-btn-danger {
    background-color: var(--danger-color) !important;
}

/* Inputs */
.layui-input, .layui-textarea {
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    padding-left: 12px;
    transition: all 0.3s;
    box-shadow: var(--shadow-sm);
}

.layui-input:focus, .layui-textarea:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Cards */
.layui-card {
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(0,0,0,0.05);
}

.layui-card-header {
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
}

/* Tables */
.layui-table {
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.layui-table th {
    background-color: #f1f5f9;
    color: var(--text-main);
    font-weight: 600;
}

/* Navigation */
.layui-nav {
    background-color: transparent;
}

.layui-nav .layui-nav-item a {
    color: rgba(255,255,255,0.8);
}

.layui-nav .layui-nav-item a:hover {
    color: #fff;
}

/* Layout Admin Overrides */
.layui-layout-admin .layui-header {
    background-color: var(--dark-bg) !important;
    box-shadow: var(--shadow-md);
}

.layui-layout-admin .layui-logo {
    color: #fff;
    font-weight: 700;
    box-shadow: none;
    border-right: 1px solid rgba(255,255,255,0.1);
}

.layui-side {
    background-color: #0f172a !important; /* Darker shade */
    box-shadow: var(--shadow-md);
}

.layui-side .layui-nav {
    background-color: transparent !important;
}

.layui-nav-tree .layui-nav-item a {
    color: #94a3b8;
}

.layui-nav-tree .layui-nav-item a:hover {
    color: #fff;
    background-color: rgba(255,255,255,0.1);
}

.layui-nav-tree .layui-this, 
.layui-nav-tree .layui-this>a, 
.layui-nav-tree .layui-nav-child dd.layui-this, 
.layui-nav-tree .layui-nav-child dd.layui-this a {
    background-color: var(--primary-color) !important;
    color: #fff !important;
    border-radius: 0 20px 20px 0; /* Modern tab look */
}

.layui-body {
    background-color: #f3f4f6;
    padding: 20px;
}

/* Login & Register Pages */
.login-page-body {
    background-color: var(--dark-bg);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background-image: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

.login-main {
    width: 400px;
    background: #fff;
    padding: 40px;
    border-radius: 1rem;
    color: var(--text-main);
    box-shadow: var(--shadow-lg);
    margin: 0 auto; /* Reset margin */
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h2 {
    color: var(--primary-color);
    font-weight: 800;
    font-size: 24px;
}

.captcha-img {
    cursor: pointer;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
}

/* Landing Page (Index) */
.index-header {
    background-color: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(10px);
    height: 70px;
    line-height: 70px;
    box-shadow: var(--shadow-md);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
}

.index-header .layui-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.index-logo {
    font-size: 24px;
    color: #fff;
    font-weight: 800;
    text-decoration: none;
    letter-spacing: -0.5px;
}

.index-nav-links a {
    color: #cbd5e1;
    margin-left: 25px;
    font-size: 15px;
    transition: color 0.3s;
    font-weight: 500;
}

.index-nav-links a:hover {
    color: #fff;
}

.hero-section {
    background: linear-gradient(135deg, #1e293b 0%, #2563eb 100%);
    padding: 160px 0 100px;
    color: #fff;
    text-align: center;
    clip-path: polygon(0 0, 100% 0, 100% 90%, 0 100%);
}

.hero-title {
    font-size: 48px;
    font-weight: 800;
    margin-bottom: 24px;
    letter-spacing: -1px;
}

.hero-desc {
    font-size: 20px;
    opacity: 0.9;
    margin-bottom: 48px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

.search-box {
    max-width: 640px;
    margin: 0 auto;
    position: relative;
}

.search-box input {
    height: 60px;
    border-radius: 30px;
    border: none;
    padding-left: 30px;
    padding-right: 120px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    font-size: 16px;
}

.search-box button {
    position: absolute;
    right: 8px;
    top: 8px;
    height: 44px;
    border-radius: 22px;
    width: 100px;
    background-color: var(--primary-color);
    border: none;
    color: #fff;
    cursor: pointer;
    transition: background 0.3s;
    font-weight: 600;
}

.search-box button:hover {
    background-color: var(--primary-hover);
}

.features-section {
    padding: 80px 0;
    background: #fff;
}

.feature-item {
    text-align: center;
    padding: 40px 30px;
    transition: transform 0.3s;
    border-radius: 1rem;
}

.feature-item:hover {
    transform: translateY(-10px);
}

.feature-icon {
    font-size: 56px;
    color: var(--primary-color);
    margin-bottom: 24px;
    display: inline-block;
}

.feature-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-main);
}

.feature-text {
    color: var(--text-secondary);
    line-height: 1.7;
}

.files-section {
    padding: 80px 0;
    background-color: #f8fafc;
}

.section-title {
    text-align: center;
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 50px;
    color: var(--text-main);
}

.file-card {
    background: #fff;
    border-radius: 1rem;
    overflow: hidden;
    transition: all 0.3s;
    margin-bottom: 24px;
    border: 1px solid rgba(0,0,0,0.05);
    box-shadow: var(--shadow-sm);
}

.file-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-5px);
}

.file-icon-wrapper {
    height: 140px;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 56px;
}

.file-info {
    padding: 20px;
}

.file-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-meta {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
}

.file-link {
    display: block;
    text-align: center;
    background: #f8fafc;
    color: var(--text-secondary);
    padding: 12px 0;
    text-decoration: none;
    transition: all 0.3s;
    font-weight: 500;
    border-top: 1px solid var(--border-color);
}

.file-link:hover {
    background: var(--primary-color);
    color: #fff;
}

/* Download Page */
.download-header {
    background: var(--dark-bg);
    height: 60px;
    line-height: 60px;
    color: #fff;
    padding: 0 20px;
    box-shadow: var(--shadow-md);
}

.download-header a {
    color: #fff;
    font-size: 18px;
    font-weight: 700;
}

.main-container {
    width: 100%;
    max-width: 1100px;
    margin: 40px auto;
    padding: 0 20px;
}

.file-box {
    background: #fff;
    padding: 40px;
    border-radius: 1rem;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(0,0,0,0.05);
}

.file-icon-large {
    font-size: 80px;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.file-info h1 {
    font-size: 28px;
    margin-bottom: 15px;
    color: var(--text-main);
    font-weight: 700;
}

.file-meta-large {
    color: var(--text-secondary);
    margin-bottom: 40px;
    font-size: 14px;
}

.file-meta-large span {
    margin-right: 25px;
}

.ad-box {
    background: #f1f5f9;
    height: 120px;
    line-height: 120px;
    text-align: center;
    color: var(--text-secondary);
    margin: 30px 0;
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
}

.download-area {
    text-align: center;
    padding: 40px 0;
    background: #f8fafc;
    border-radius: 1rem;
    margin-top: 30px;
}

.vip-tip {
    margin-top: 15px;
    color: var(--danger-color);
    font-size: 13px;
    font-weight: 500;
}

/* Error Page */
.error-page-body {
    background-color: var(--light-bg);
    text-align: center;
    padding-top: 120px;
}

.error-box {
    background: #fff;
    padding: 60px;
    display: inline-block;
    border-radius: 1rem;
    box-shadow: var(--shadow-lg);
}

.error-box h1 {
    font-size: 24px;
    color: var(--text-main);
    margin-bottom: 30px;
    font-weight: 700;
}

/* Upload Popup */
.upload-popup-body {
    padding: 20px;
    background-color: #fff;
}

.upload-drag-zone {
    border: 2px dashed var(--primary-color);
    border-radius: var(--border-radius);
    padding: 40px;
    text-align: center;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s;
    background-color: var(--light-bg);
}

.upload-drag-zone:hover {
    background: #eff6ff;
    border-color: var(--primary-hover);
}

.upload-drag-zone i {
    font-size: 60px;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.file-list {
    margin-top: 25px;
}

.file-item {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    background: #fff;
    transition: background 0.2s;
}

.file-item:hover {
    background-color: var(--light-bg);
}

.file-info {
    flex: 1;
}

.file-name {
    font-weight: 600;
    color: var(--text-main);
}

.file-size {
    color: var(--text-secondary);
    font-size: 12px;
    margin-top: 4px;
}

.file-progress {
    width: 200px;
    margin: 0 20px;
}

.file-status {
    width: 100px;
    text-align: right;
    font-size: 13px;
    font-weight: 500;
}

/* Popup Pages */
.popup-body {
    background-color: #fff;
    padding: 20px;
}

/* Footer */
.footer {
    background-color: var(--light-bg);
    padding: 60px 0;
    text-align: center;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
    margin-top: 0;
}

.footer p {
    margin-bottom: 10px;
}

.footer a {
    color: var(--text-secondary);
    margin: 0 12px;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
}

.footer a:hover {
    color: var(--primary-color);
}
