/* Admin Panel Styles */

:root {
    --primary-blue: #0066CC;
    --secondary-blue: #1F7FE3;
    --accent-yellow: #FFC200;
    --light-blue: #E3F2FD;
    --dark-text: #1A202C;
    --light-text: #4A5568;
    --light-bg: #F8FAFC;
    --white: #FFFFFF;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 10px 32px rgba(0, 0, 0, 0.15);
}

body {
    font-family: 'Segoe UI', 'Helvetica Neue', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--light-bg);
    margin: 0;
    padding: 0;
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--secondary-blue) 100%);
    padding: 20px;
}

.login-box {
    background: var(--white);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    color: var(--primary-blue);
    margin: 0;
    font-size: 1.8rem;
    font-weight: 700;
}

.login-header p {
    color: var(--light-text);
    margin: 0.5rem 0 0 0;
    font-size: 0.95rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 0.5rem;
    color: var(--dark-text);
    font-weight: 600;
    font-size: 0.95rem;
}

.form-group input {
    padding: 0.75rem;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.btn-login {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--secondary-blue) 100%);
    color: var(--white);
    padding: 0.75rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.login-info {
    background-color: var(--light-blue);
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: var(--dark-text);
}

.login-info p {
    margin: 0.5rem 0;
}

.login-info code {
    background-color: var(--white);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: monospace;
    color: var(--primary-blue);
    font-weight: 600;
}

.back-link {
    text-align: center;
    margin-top: 1.5rem;
}

.back-link a {
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.back-link a:hover {
    color: var(--secondary-blue);
}

/* Admin Dashboard */
.admin-container {
    display: flex;
    min-height: 100vh;
    background-color: var(--light-bg);
}

.sidebar {
    width: 250px;
    background: linear-gradient(180deg, var(--primary-blue) 0%, var(--secondary-blue) 100%);
    color: var(--white);
    padding: 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    left: 0;
    top: 0;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.5rem;
    cursor: pointer;
}

.sidebar-nav {
    padding: 1rem 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.nav-item:hover,
.nav-item.active {
    background-color: rgba(255,255,255,0.1);
    color: var(--white);
    border-left-color: var(--accent-yellow);
}

.nav-item .icon {
    font-size: 1.3rem;
}

.sidebar hr {
    border: none;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin: 1rem 0;
}

.main-content {
    margin-left: 250px;
    flex: 1;
    padding: 0;
}

.topbar {
    background-color: var(--white);
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
}

.topbar h1 {
    margin: 0;
    color: var(--primary-blue);
    font-weight: 700;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.tab-content {
    display: none;
    padding: 2rem;
}

.tab-content.active {
    display: block;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--secondary-blue);
}

.stat-card h3 {
    margin: 0 0 0.5rem 0;
    color: var(--light-text);
    font-size: 0.95rem;
    font-weight: 600;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-blue);
    margin: 0;
}

.stat-status {
    color: #27ae60;
    font-weight: 600;
    margin: 0;
}

.recent-news {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.recent-news h2 {
    margin-top: 0;
    color: #1a5490;
}

.news-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.news-item-mini {
    padding: 1rem;
    border-left: 3px solid #1a5490;
    background-color: #f9f9f9;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.news-item-mini:hover {
    background-color: #f0f0f0;
    transform: translateX(5px);
}

.news-item-mini h4 {
    margin: 0 0 0.5rem 0;
    color: #1a5490;
}

.news-item-mini p {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
}

/* News Management */
.news-management,
.post-news-form {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.news-management h2,
.post-news-form h2 {
    color: #1a5490;
    margin-top: 0;
}

.filter-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.search-input,
.sort-select {
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

.search-input {
    flex: 1;
}

.sort-select {
    min-width: 150px;
}

.admin-news-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.news-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1.5rem;
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    transition: all 0.3s ease;
    align-items: start;
}

.news-item:hover {
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    border-color: #1a5490;
}

.news-item-image {
    width: 120px;
    height: 80px;
    object-fit: cover;
    border-radius: 5px;
}

.news-item-content h3 {
    margin: 0 0 0.5rem 0;
    color: #1a5490;
}

.news-item-content p {
    margin: 0 0 0.5rem 0;
    color: #666;
    font-size: 0.9rem;
}

.news-item-date {
    color: #999;
    font-size: 0.85rem;
}

.news-item-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-edit,
.btn-delete,
.btn-submit,
.btn-reset {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.btn-edit {
    background: linear-gradient(135deg, var(--secondary-blue) 0%, var(--primary-blue) 100%);
    color: var(--white);
}

.btn-edit:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-delete {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: var(--white);
}

.btn-delete:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-submit {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    color: var(--white);
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-reset {
    background: linear-gradient(135deg, var(--light-text) 0%, #5A6772 100%);
    color: var(--white);
}

.btn-reset:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Form Styles */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.post-news-form .form-group {
    margin-bottom: 1.5rem;
}

.post-news-form label {
    display: block;
    margin-bottom: 0.5rem;
    color: #333;
    font-weight: 500;
}

.post-news-form input,
.post-news-form textarea,
.post-news-form select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    font-family: inherit;
}

.post-news-form input:focus,
.post-news-form textarea:focus,
.post-news-form select:focus {
    outline: none;
    border-color: #1a5490;
    box-shadow: 0 0 5px rgba(26, 84, 144, 0.3);
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-start;
    margin-top: 2rem;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h2 {
    margin: 0;
    color: #1a5490;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
}

.modal-close:hover {
    color: #333;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        width: 80px;
    }

    .sidebar-header h2,
    .nav-item span:not(.icon) {
        display: none;
    }

    .menu-toggle {
        display: block;
    }

    .main-content {
        margin-left: 80px;
    }

    .topbar {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .filter-bar {
        flex-direction: column;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .news-item {
        grid-template-columns: 1fr;
    }

    .news-item-image {
        width: 100%;
        height: 200px;
    }
}