/* ===================================
   Admin Page Styles
   =================================== */

:root {
    --admin-primary: #2196F3;
    --admin-secondary: #64B5F6;
    --admin-success: #4CAF50;
    --admin-warning: #FF9800;
    --admin-danger: #f44336;
    --admin-dark: #1a1a1a;
    --admin-gray: #757575;
    --admin-light-gray: #f5f5f5;
    --admin-sidebar-width: 260px;
}

/* ===================================
   Login Page
   =================================== */

.admin-login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 450px;
}

.login-box {
    background: white;
    border-radius: 20px;
    padding: 50px 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 0.5s ease;
}

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

.login-box.shake {
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

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

.login-logo {
    width: 120px;
    height: auto;
    margin-bottom: 20px;
}

.login-header h1 {
    font-size: 28px;
    font-weight: 600;
    color: var(--admin-dark);
    margin-bottom: 10px;
}

.login-header p {
    color: var(--admin-gray);
    font-size: 14px;
}

.login-form .form-group {
    margin-bottom: 25px;
}

.login-form label {
    display: block;
    font-weight: 500;
    color: var(--admin-dark);
    margin-bottom: 10px;
    font-size: 14px;
}

.login-form label i {
    margin-right: 8px;
    color: var(--admin-primary);
}

.login-form input[type="text"],
.login-form input[type="password"] {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.3s ease;
}

.login-form input:focus {
    outline: none;
    border-color: var(--admin-primary);
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.form-group-checkbox {
    margin-bottom: 25px;
}

.form-group-checkbox label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 400;
}

.form-group-checkbox input[type="checkbox"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.login-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--admin-primary), var(--admin-secondary));
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(33, 150, 243, 0.3);
}

.login-btn i {
    margin-right: 8px;
}

.login-footer {
    text-align: center;
    margin-top: 25px;
}

.login-footer a {
    color: var(--admin-gray);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

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

.error-message {
    margin-top: 20px;
    padding: 15px;
    border-radius: 10px;
    background: linear-gradient(135deg, #f44336, #e57373);
    color: white;
    text-align: center;
    font-size: 14px;
    display: none;
}

.error-message i {
    margin-right: 8px;
}

/* ===================================
   Admin Dashboard Layout
   =================================== */

.admin-page {
    display: flex;
    min-height: 100vh;
    background: #f8f9fa;
    overflow-x: hidden;
}

/* Sidebar */
.admin-sidebar {
    width: var(--admin-sidebar-width);
    background: linear-gradient(180deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.admin-sidebar.collapsed {
    transform: translateX(-100%);
}

.sidebar-header {
    padding: 30px 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo {
    width: 100px;
    height: auto;
    margin-bottom: 15px;
    filter: brightness(0) invert(1);
}

.sidebar-header h2 {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
}

.sidebar-nav .nav-item {
    display: flex;
    align-items: center;
    padding: 15px 25px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.sidebar-nav .nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.sidebar-nav .nav-item.active {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border-left-color: white;
}

.sidebar-nav .nav-item i {
    width: 24px;
    margin-right: 15px;
    font-size: 18px;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-info {
    display: flex;
    align-items: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    margin-bottom: 15px;
}

.admin-info i {
    font-size: 20px;
    margin-right: 10px;
}

.logout-btn {
    width: 100%;
    padding: 12px;
    background: rgba(244, 67, 54, 0.8);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logout-btn:hover {
    background: rgba(244, 67, 54, 1);
}

.logout-btn i {
    margin-right: 8px;
}

/* Main Content */
.admin-main {
    flex: 1;
    margin-left: var(--admin-sidebar-width);
    display: flex;
    flex-direction: column;
}

/* Header */
.admin-header {
    background: white;
    padding: 20px 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--admin-dark);
    cursor: pointer;
}

.admin-header h1 {
    font-size: 24px;
    font-weight: 600;
    color: var(--admin-dark);
    margin: 0;
}

.header-right {
    display: flex;
    gap: 15px;
}

.header-btn {
    padding: 10px 20px;
    background: var(--admin-light-gray);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    color: var(--admin-dark);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

/* View Content */
.view-content {
    display: none;
    padding: 30px;
    animation: fadeIn 0.3s ease;
}

.view-content.active {
    display: block;
}

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

/* Dashboard Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    width: 70px;
    height: 70px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 30px;
}

.stat-info h3 {
    font-size: 14px;
    color: var(--admin-gray);
    font-weight: 500;
    margin-bottom: 8px;
}

.stat-number {
    font-size: 32px;
    font-weight: 700;
    color: var(--admin-dark);
    margin: 0;
}

.welcome-section {
    background: white;
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.welcome-section h2 {
    font-size: 28px;
    font-weight: 600;
    color: var(--admin-dark);
    margin-bottom: 15px;
}

.welcome-section p {
    color: var(--admin-gray);
    font-size: 16px;
    line-height: 1.8;
    margin-bottom: 10px;
}

/* Board Actions */
.board-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    gap: 20px;
}

.action-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 10px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.action-btn.primary {
    background: linear-gradient(135deg, var(--admin-primary), var(--admin-secondary));
    color: white;
}

.action-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(33, 150, 243, 0.3);
}

.board-actions .search-box {
    display: flex;
    gap: 10px;
}

.board-actions .search-box input {
    padding: 12px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 14px;
    width: 300px;
}

.board-actions .search-box button {
    padding: 12px 20px;
    background: var(--admin-primary);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.board-actions .search-box button:hover {
    background: var(--admin-secondary);
}

/* Board Table */
.board-table-wrapper {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 25px;
}

.board-table {
    width: 100%;
    border-collapse: collapse;
}

.board-table thead {
    background: var(--admin-light-gray);
}

.board-table th {
    padding: 18px;
    text-align: left;
    font-weight: 600;
    color: var(--admin-dark);
    font-size: 14px;
}

.board-table td {
    padding: 18px;
    border-top: 1px solid #e0e0e0;
    font-size: 14px;
    color: var(--admin-dark);
}

.board-table tbody tr {
    transition: background 0.2s ease;
}

.board-table tbody tr:hover {
    background: #f8f9fa;
}

.board-table td.loading {
    text-align: center;
    padding: 50px;
    color: var(--admin-gray);
}

.table-actions {
    display: flex;
    gap: 8px;
}

.table-btn {
    padding: 8px 15px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.table-btn.edit {
    background: #4CAF50;
    color: white;
}

.table-btn.delete {
    background: #f44336;
    color: white;
}

.table-btn:hover {
    opacity: 0.8;
    transform: translateY(-2px);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: 20px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideUp 0.3s ease;
}

.modal-content.large {
    max-width: 900px;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    border-bottom: 1px solid #e0e0e0;
}

.modal-header h2 {
    font-size: 22px;
    font-weight: 600;
    color: var(--admin-dark);
    margin: 0;
}

.modal-close {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--admin-light-gray);
    color: var(--admin-dark);
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: var(--admin-danger);
    color: white;
    transform: rotate(90deg);
}

.modal-body {
    padding: 30px;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    font-weight: 500;
    color: var(--admin-dark);
    margin-bottom: 10px;
    font-size: 14px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--admin-primary);
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

/* Quill Editor */
#quillEditor {
    background: white;
    border-radius: 8px;
    min-height: 300px;
}

.ql-toolbar {
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    background: var(--admin-light-gray);
}

.ql-container {
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    font-size: 15px;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 30px;
}

.btn-primary,
.btn-secondary {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--admin-primary), var(--admin-secondary));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(33, 150, 243, 0.3);
}

.btn-secondary {
    background: var(--admin-light-gray);
    color: var(--admin-dark);
}

.btn-secondary:hover {
    background: #e0e0e0;
}

/* Responsive */
@media (max-width: 968px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }
    
    .admin-sidebar.active {
        transform: translateX(0);
    }
    
    .admin-main {
        margin-left: 0;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .board-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .board-actions .search-box input {
        width: 100%;
    }
    
    .board-table-wrapper {
        overflow-x: auto;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .modal-content {
        max-width: 100%;
        border-radius: 15px;
    }
    
    .board-table th:nth-child(3),
    .board-table td:nth-child(3),
    .board-table th:nth-child(4),
    .board-table td:nth-child(4) {
        display: none;
    }
}
