@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css');

@font-face {
    font-family: 'Sansation';
    src: url('../assets/Sansation-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}
@font-face {
    font-family: 'Sansation';
    src: url('../assets/Sansation-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
}
@font-face {
    font-family: 'Sansation';
    src: url('../assets/Sansation-Italic.ttf') format('truetype');
    font-weight: 400;
    font-style: italic;
}
@font-face {
    font-family: 'Sansation';
    src: url('../assets/Sansation-BoldItalic.ttf') format('truetype');
    font-weight: 700;
    font-style: italic;
}
@font-face {
    font-family: 'Sansation';
    src: url('../assets/Sansation-Light.ttf') format('truetype');
    font-weight: 300;
    font-style: normal;
}
@font-face {
    font-family: 'Sansation';
    src: url('../assets/Sansation-LightItalic.ttf') format('truetype');
    font-weight: 300;
    font-style: italic;
}

:root {
    --bg-color: #f8fafc; /* Crisp light background */
    --panel-bg: #ffffff; 
    --sidebar-bg: transparent;
    --sidebar-icon: #64748b;
    --sidebar-icon-active: #ffffff;
    --sidebar-icon-active-bg: var(--primary);
    --text-dark: #0f172a; 
    --text-muted: #64748b; 
    /* Primary injected via main.php */
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Sansation', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-dark);
    margin: 0;
    padding: 0;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 0;
}

body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('../assets/bg.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    opacity: 0.5;
    z-index: -1;
}

.app-container {
    display: flex;
    flex-direction: row-reverse;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    padding: 2rem;
    gap: 2rem;
}

/* Sidebar */
.sidebar {
    width: 120px;
    background-color: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.sidebar-menus {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin: auto 0;
}

.sidebar-bottom {
    margin-top: auto;
}

.nav-item {
    width: 90px;
    height: 90px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 20px;
    background-color: var(--primary);
    color: #ffffff;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 700;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
    gap: 0.5rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.nav-item i {
    display: block;
    font-size: 1.8rem;
    margin-bottom: 2px;
}

.nav-item:hover, .nav-item.active {
    background-color: #ffffff;
    color: var(--primary);
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
    border: 2px solid var(--primary);
}

.lang-toggle {
    font-size: 1rem;
    font-weight: 700;
}

/* Main Content Area */
.main-content {
    flex: 1;
    display: block;
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
    height: 100%;
    background-color: var(--panel-bg);
    border-radius: 30px;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.1);
}

/* Home Layout */
.home-layout {
    display: flex;
    width: 100%;
    height: 100%;
    padding: 2rem;
    gap: 3rem;
}

.home-image {
    flex: 1;
    border-radius: 20px;
    overflow: hidden;
}

.home-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.home-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-right: 2rem;
}

.home-text h1 {
    font-size: 3.5rem;
    color: var(--primary);
    line-height: 1.1;
    margin-bottom: 1rem;
}

.home-text h2 {
    font-size: 1.5rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.home-text p {
    color: var(--text-muted);
    margin-bottom: 3rem;
}

.btn-start {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--primary);
    border-radius: 10px;
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
    width: max-content;
    transition: all 0.3s;
}

.btn-start:hover {
    background-color: var(--primary);
    color: white;
}

.social-links {
    margin-top: auto;
    display: flex;
    gap: 1rem;
    color: var(--text-muted);
}

.social-links a {
    color: inherit;
    font-size: 1.2rem;
    text-decoration: none;
}

/* Form Layout */
.form-layout {
    width: 100%;
    min-height: 100%;
    padding: 3rem;
    display: flex;
    flex-direction: column;
}

.form-layout h2 {
    color: var(--primary);
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}
.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-dark); 
    font-weight: 600;
    font-size: 1.1rem;
}
.form-control {
    width: 100%;
    padding: 1rem;
    border: 2px solid #cbd5e1; 
    border-radius: 10px;
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-dark);
    background: white;
    transition: all 0.3s;
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(0,0,0,0.05);
}
textarea.form-control {
    resize: vertical;
    min-height: 100px;
}
.btn-submit {
    background: var(--primary);
    color: white;
    border: none;
    box-shadow: 0 10px 20px -5px rgba(0,0,0,0.2);
    padding: 1rem 2rem;
    border-radius: 10px;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.btn-submit:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 25px -5px rgba(0,0,0,0.3);
}
.error-message {
    color: #ef4444;
    font-size: 0.85rem;
    display: none;
    margin-top: 5px;
}
.has-error .error-message {
    display: block;
}
.has-error .form-control {
    border-color: #ef4444;
}

/* Admin Dashboard Layout */
.admin-layout {
    width: 100%;
    min-height: 100%;
    padding: 2rem 3rem;
    display: flex;
    flex-direction: column;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.admin-header h2 {
    color: var(--primary);
    margin: 0;
}

.admin-nav {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.btn-nav {
    padding: 0.5rem 1rem;
    background: var(--primary);
    color: white;
    border: 2px solid var(--primary);
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: 0.3s;
}

.btn-nav:hover, .btn-nav.active {
    background: white;
    color: var(--primary);
}

.btn-export {
    background: var(--primary);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    border: 2px solid var(--primary);
    transition: 0.3s;
}
.btn-export:hover {
    opacity: 0.9;
}

.dashboard-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    background: white;
    padding: 1rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.dashboard-filters input, .dashboard-filters select {
    padding: 0.5rem;
    border: 2px solid #cbd5e1;
    border-radius: 6px;
    font-weight: 500;
    outline: none;
}
.dashboard-filters input:focus, .dashboard-filters select:focus {
    border-color: var(--primary);
}

.chart-container {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    margin-bottom: 2rem;
    height: 300px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}
.data-table th, .data-table td {
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

/* Pagination Styles */
.pagination-wrapper {
    display: flex;
    justify-content: center;
    padding: 1.5rem;
    background: white;
}
.pagination-wrapper .pagination {
    display: flex;
    list-style: none;
    gap: 0.5rem;
    padding: 0;
    margin: 0;
}
.pagination-wrapper .pagination li a,
.pagination-wrapper .pagination li span {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    background: #f3f4f6;
    color: var(--text-dark);
    text-decoration: none;
    transition: 0.2s;
}
.pagination-wrapper .pagination li.active a,
.pagination-wrapper .pagination li.active span {
    background: var(--primary);
    color: white;
}
.pagination-wrapper .pagination li a:hover {
    background: var(--primary-light);
    color: white;
}
.data-table th {
    background: #f8fafc;
    color: var(--text-muted);
    font-weight: 600;
}

/* Admin Login Layout */
.login-layout {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}
.login-box {
    background: white;
    padding: 3rem;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
    text-align: center;
}
.login-box h2 {
    color: var(--primary);
    margin-bottom: 2rem;
}

/* Loader */
.loading-spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

.success-overlay {
    position: absolute;
    top:0;left:0;right:0;bottom:0;
    background: rgba(255,255,255,0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 50;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}
.success-overlay.active {
    opacity: 1;
    pointer-events: all;
}
.success-overlay h2 {
    color: var(--primary);
}
