/* CSS Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2c5aa0;
    --secondary-color: #1a3c7d;
    --accent-color: #4cc9f0;
    --light-color: #f8f9fa;
    --dark-color: #1a1a2e;
    --success-color: #2ecc71;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --text-color: #333;
    --text-light: #666;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --border-radius: 12px;
    --gradient: linear-gradient(135deg, #2c5aa0 0%, #1a3c7d 100%);
    --gradient-accent: linear-gradient(135deg, #4cc9f0 0%, #4361ee 100%);
}

[data-theme="dark"] {
    --primary-color: #4361ee;
    --secondary-color: #3a0ca3;
    --light-color: #1a1a2e;
    --dark-color: #0f1123;
    --text-color: #e2e8f0;
    --text-light: #94a3b8;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Background Elements */
.background-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.floating-shape {
    position: absolute;
    border-radius: 50%;
    background: var(--gradient-accent);
    opacity: 0.1;
    filter: blur(40px);
    animation: float 20s infinite linear;
}

.shape-1 {
    width: 400px;
    height: 400px;
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.shape-2 {
    width: 300px;
    height: 300px;
    bottom: -50px;
    right: -50px;
    animation-delay: -5s;
    background: var(--gradient);
}

.shape-3 {
    width: 200px;
    height: 200px;
    top: 30%;
    right: 10%;
    animation-delay: -10s;
}

.shape-4 {
    width: 250px;
    height: 250px;
    bottom: 20%;
    left: 5%;
    animation-delay: -15s;
}

.shape-5 {
    width: 150px;
    height: 150px;
    top: 60%;
    left: 20%;
    animation-delay: -7s;
}

.shape-6 {
    width: 180px;
    height: 180px;
    top: 10%;
    right: 20%;
    animation-delay: -12s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    25% {
        transform: translate(50px, 50px) rotate(90deg);
    }
    50% {
        transform: translate(0, 100px) rotate(180deg);
    }
    75% {
        transform: translate(-50px, 50px) rotate(270deg);
    }
}

/* Base Styles */
body {
    font-family: 'Poppins', sans-serif;
    background: var(--light-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: var(--transition);
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
.header {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    transition: var(--transition);
}

[data-theme="dark"] .header {
    background: rgba(26, 26, 46, 0.9);
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-icon {
    width: 50px;
    height: 50px;
    background: var(--gradient);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.logo-text h1 {
    font-size: 24px;
    font-weight: 700;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-text h1 span {
    color: var(--accent-color);
}

.logo-text p {
    font-size: 12px;
    color: var(--text-light);
    margin-top: -5px;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 20px;
}

.search-box {
    position: relative;
    width: 300px;
}

.search-box i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
}

.search-box input {
    width: 100%;
    padding: 12px 20px 12px 45px;
    border: 2px solid rgba(44, 90, 160, 0.2);
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.8);
    color: var(--text-color);
    font-size: 14px;
    transition: var(--transition);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(44, 90, 160, 0.1);
}

[data-theme="dark"] .search-box input {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text-color);
}

/* Theme Toggle */
.theme-label {
    display: flex;
    align-items: center;
    background: var(--gradient);
    width: 60px;
    height: 30px;
    border-radius: 50px;
    padding: 5px;
    cursor: pointer;
    position: relative;
    transition: var(--transition);
}

.theme-label i {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 14px;
    transition: var(--transition);
}

.theme-label .fa-sun {
    left: 8px;
}

.theme-label .fa-moon {
    right: 8px;
}

.toggle-ball {
    position: absolute;
    left: 5px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: var(--transition);
}

#theme-switch:checked + .theme-label .toggle-ball {
    transform: translateX(30px);
}

/* Main Content */
.main-container {
    padding: 30px 0;
    animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Stats Bar */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid rgba(0, 0, 0, 0.05);
    animation: slideUp 0.6s ease-out;
}

[data-theme="dark"] .stat-card {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.2s; }
.stat-card:nth-child(3) { animation-delay: 0.3s; }

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stat-icon {
    width: 50px;
    height: 50px;
    background: var(--gradient);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
}

.stat-content h3 {
    font-size: 24px;
    font-weight: 700;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 5px;
}

.stat-content p {
    font-size: 14px;
    color: var(--text-light);
}

/* Table Container */
.table-container {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: var(--transition);
    animation: fadeIn 1s ease-out;
}

[data-theme="dark"] .table-container {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.table-header {
    padding: 25px 30px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

[data-theme="dark"] .table-header {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.table-header h2 {
    font-size: 22px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.table-header h2 i {
    color: var(--primary-color);
}

.table-controls {
    display: flex;
    gap: 10px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-filter {
    background: rgba(44, 90, 160, 0.1);
    color: var(--primary-color);
}

.btn-filter:hover {
    background: rgba(44, 90, 160, 0.2);
}

.btn-export {
    background: var(--gradient);
    color: white;
}

.btn-export:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(44, 90, 160, 0.3);
}

/* Table Styles */
.table-wrapper {
    overflow-x: auto;
    padding: 0 30px;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 800px;
}

thead {
    background: var(--gradient);
}

th {
    padding: 20px 15px;
    text-align: left;
    color: white;
    font-weight: 500;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.th-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sort-icon {
    cursor: pointer;
    opacity: 0.7;
    transition: var(--transition);
}

.sort-icon:hover {
    opacity: 1;
    transform: scale(1.1);
}

th small {
    font-size: 11px;
    opacity: 0.8;
    font-weight: 400;
    text-transform: none;
}

tbody tr {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: var(--transition);
    animation: slideIn 0.5s ease-out;
}

[data-theme="dark"] tbody tr {
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

tbody tr:hover {
    background: rgba(44, 90, 160, 0.05);
    transform: translateX(5px);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

td {
    padding: 20px 15px;
    font-size: 14px;
}

.surah-no {
    width: 100px;
    font-weight: 600;
    color: var(--primary-color);
    font-size: 16px;
}

.surah-name {
    font-family: 'Amiri', serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-color);
}

.verse-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 15px;
    background: rgba(44, 90, 160, 0.1);
    color: var(--primary-color);
    text-decoration: none;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    margin: 3px;
    transition: var(--transition);
    animation: popIn 0.3s ease-out;
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.verse-link:hover {
    background: var(--gradient);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(44, 90, 160, 0.3);
}

.verse-link i {
    font-size: 10px;
}

.verse-separator {
    color: var(--text-light);
    margin: 0 5px;
    font-weight: 300;
}

.no-verses {
    color: var(--text-light);
    font-style: italic;
    padding: 10px;
}

/* Table Footer */
.table-footer {
    padding: 20px 30px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

[data-theme="dark"] .table-footer {
    border-top-color: rgba(255, 255, 255, 0.05);
}

.pagination-info {
    color: var(--text-light);
    font-size: 14px;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.pagination-btn {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    background: white;
    color: var(--text-color);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

[data-theme="dark"] .pagination-btn {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.pagination-btn:hover:not(:disabled) {
    background: var(--gradient);
    color: white;
    border-color: transparent;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-info {
    font-size: 14px;
    color: var(--text-color);
}

/* Quick Actions */
.quick-actions {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1000;
}

.action-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--gradient);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: var(--transition);
    box-shadow: 0 5px 20px rgba(44, 90, 160, 0.3);
    position: relative;
    overflow: hidden;
}

.action-btn:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 10px 30px rgba(44, 90, 160, 0.4);
}

.action-btn i {
    font-size: 18px;
}

.action-btn span {
    font-size: 9px;
    margin-top: 2px;
}

/* Footer */
.footer {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 40px 0 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    margin-top: 50px;
}

[data-theme="dark"] .footer {
    background: rgba(26, 26, 46, 0.9);
    border-top-color: rgba(255, 255, 255, 0.1);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 30px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
}

.footer-logo i {
    font-size: 24px;
}

.footer-text {
    color: var(--text-light);
    line-height: 1.8;
    max-width: 400px;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-link {
    color: var(--text-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: var(--transition);
}

.footer-link:hover {
    color: var(--primary-color);
    transform: translateX(5px);
}

.copyright {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    color: var(--text-light);
    font-size: 14px;
}

[data-theme="dark"] .copyright {
    border-top-color: rgba(255, 255, 255, 0.1);
}

.copyright i {
    color: #e74c3c;
    margin: 0 5px;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--gradient);
    color: white;
    padding: 15px 25px;
    border-radius: 50px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 2000;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast-icon {
    font-size: 20px;
}

.toast-message {
    font-size: 14px;
    font-weight: 500;
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 992px) {
    .header .container {
        flex-direction: column;
        gap: 20px;
    }
    
    .search-box {
        width: 100%;
    }
    
    .stats-bar {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .table-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .table-controls {
        width: 100%;
    }
    
    .btn {
        flex: 1;
        justify-content: center;
    }
    
    .stats-bar {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
    }
    
    .quick-actions {
        bottom: 20px;
        right: 20px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .table-wrapper {
        padding: 0 15px;
    }
    
    .table-header,
    .table-footer {
        padding: 15px;
    }
    
    .pagination-controls {
        gap: 5px;
    }
}