/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f4f6f9;
}

/* Header */
.main-header {
    background-color: #003399;
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-title {
    font-size: 1.5rem;
    font-weight: 600;
}

.main-nav {
    display: flex;
    gap: 1.5rem;
}

.main-nav a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.3s;
    line-height: 1;
    text-align: center;
}

.main-nav a:hover {
    background-color: rgba(255,255,255,0.1);
}

.logout-link {
    background-color: #FFCC00;
    color: #003399;
    font-weight: 600;
}

.logout-link:hover {
    background-color: #e6b800;
}

.user-info {
    font-size: 0.9rem;
}

/* User Dropdown */
.user-dropdown {
    position: relative;
}

.user-avatar-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    color: white;
    cursor: pointer;
    transition: background-color 0.3s;
    line-height: 1;
}

.user-avatar-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #FFCC00;
    color: #003399;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    line-height: 1;
}

.user-name {
    font-size: 0.95rem;
    font-weight: 500;
}

.dropdown-arrow {
    transition: transform 0.3s;
}

.user-avatar-btn:hover .dropdown-arrow {
    transform: translateY(2px);
}

.user-dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.3s, transform 0.3s, visibility 0.3s;
    z-index: 1000;
}

.user-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    color: #333;
    text-decoration: none;
    transition: background-color 0.2s;
    line-height: 1;
    white-space: nowrap;
}

.dropdown-item:first-child {
    border-radius: 8px 8px 0 0;
}

.dropdown-item:last-child {
    border-radius: 0 0 8px 8px;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
}

.dropdown-item svg {
    color: #666;
    flex-shrink: 0;
}

.logout-item {
    border-top: 1px solid #eee;
}

.logout-item:hover {
    background-color: #fff3f3;
}

.logout-item svg {
    color: #dc3545;
}

/* Container */
.container {
    max-width: 1440px;
    margin: 2rem auto;
    padding: 0 20px;
}

.main-content {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Login Page */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #003399 0%, #0055cc 100%);
}

.login-box {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    color: #003399;
    margin-bottom: 0.5rem;
    text-align: center;
}

.login-box h2 {
    color: #7f8c8d;
    margin-bottom: 1.5rem;
    text-align: center;
    font-weight: 400;
}

.login-info {
    margin-top: 1rem;
    text-align: center;
    color: #7f8c8d;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #555;
    font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.form-group input[type="text"]:focus,
.form-group input[type="email"]:focus,
.form-group input[type="password"]:focus,
.form-group select:focus {
    outline: none;
    border-color: #003399;
}

.form-group input[type="checkbox"] {
    margin-right: 0.5rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.3s;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
}

.btn-primary {
    background-color: #003399;
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background-color: #002266;
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

.btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
}

.btn-warning {
    background-color: #FFCC00;
    color: #003399;
    font-weight: 600;
}

.btn-warning:hover {
    background-color: #e6b800;
}

.btn-danger {
    background-color: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background-color: #c0392b;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
}

.alert-error {
    background-color: #fee;
    color: #c00;
    border: 1px solid #fcc;
}

.alert-success {
    background-color: #efe;
    color: #060;
    border: 1px solid #cfc;
}

/* Dashboard */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.dashboard-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.stat-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s, box-shadow 0.3s;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0, 51, 153, 0.1);
}

.stat-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.stat-card h3 {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #003399;
    line-height: 1.2;
}

.statistics-section {
    margin-bottom: 3rem;
}

.charts-section {
    margin-bottom: 3rem;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin: 1.5rem 0;
}

.chart-container {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.chart-container h3 {
    color: #003399;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    text-align: center;
}

.chart-container canvas {
    max-height: 300px;
}

.quick-actions {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid #e0e0e0;
}

.quick-actions h2 {
    margin-bottom: 1rem;
    color: #003399;
}

.quick-actions .btn {
    margin-right: 1rem;
    margin-bottom: 0.5rem;
    width: auto;
}

@media (max-width: 768px) {
    .dashboard-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        text-align: center;
    }
}

/* User Table */
.actions-bar {
    margin-bottom: 1.5rem;
}

.user-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.user-table th,
.user-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.user-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #003399;
}

.user-table tr:hover {
    background-color: #f8f9fa;
}

.user-table .actions {
    white-space: nowrap;
}

.user-table .actions .btn {
    margin-right: 0.5rem;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
}

.badge-admin {
    background-color: #e6f0ff;
    color: #003399;
}

.badge-editor {
    background-color: #f0e8fd;
    color: #6b0acc;
}

.badge-active {
    background-color: #e8f8f0;
    color: #008844;
}

.badge-inactive {
    background-color: #fee;
    color: #c00;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.form-actions .btn {
    width: auto;
}

/* Projects Pages */
.actions-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #ddd;
}

.actions-bar .stats {
    font-size: 1.1rem;
}

.actions-bar .actions {
    display: flex;
    gap: 0.5rem;
}

.projects-table-container {
    overflow-x: auto;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: #7f8c8d;
}

/* Import Form */
.import-form {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 2rem 0;
}

.import-form h3 {
    margin-bottom: 1rem;
}

.import-info {
    background: #e6f0ff;
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 2rem;
}

.import-info h3 {
    color: #003399;
    margin-bottom: 1rem;
}

.import-info ul {
    margin-left: 1.5rem;
    color: #555;
}

.import-info li {
    margin-bottom: 0.5rem;
}

/* File input styling */
input[type="file"] {
    border: 2px dashed #ddd;
    padding: 1rem;
    border-radius: 4px;
    width: 100%;
    cursor: pointer;
    transition: border-color 0.3s;
}

input[type="file"]:hover {
    border-color: #003399;
}

/* Project Details */
.project-details {
    margin: 2rem 0;
}

.detail-section {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.detail-section h3 {
    color: #003399;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #003399;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.detail-item strong {
    color: #555;
    font-size: 0.9rem;
}

.detail-item span {
    color: #003399;
    font-size: 1rem;
}

.detail-section p {
    line-height: 1.8;
    color: #555;
}

.detail-section a {
    color: #003399;
    text-decoration: none;
}

.detail-section a:hover {
    text-decoration: underline;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #ddd;
}

.pagination-btn {
    padding: 0.5rem 1rem;
    background-color: #003399;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: background-color 0.3s;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
}

.pagination-btn:hover {
    background-color: #002266;
}

.pagination-numbers {
    display: flex;
    gap: 0.25rem;
}

.pagination-number {
    padding: 0.5rem 0.75rem;
    background-color: #f8f9fa;
    color: #003399;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: all 0.3s;
    border: 1px solid #ddd;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
}

.pagination-number:hover {
    background-color: #e6f0ff;
    border-color: #003399;
}

.pagination-number.active {
    background-color: #003399;
    color: white;
    border-color: #003399;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .main-nav {
        flex-wrap: wrap;
    }
    
    .user-table {
        font-size: 0.9rem;
    }
    
    .user-table th,
    .user-table td {
        padding: 0.5rem;
    }
    
    .actions-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .actions-bar .actions {
        width: 100%;
        flex-direction: column;
    }
    
    .actions-bar .actions .btn {
        width: 100%;
    }
    
    .pagination {
        flex-wrap: wrap;
    }
    
    .pagination-btn,
    .pagination-number {
        font-size: 0.85rem;
        padding: 0.4rem 0.6rem;
    }
}

/* Spinner/Loading Animation */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

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

.btn.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.btn.loading .btn-text {
    visibility: hidden;
}

.btn.loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* Public Project Details */
.project-title-link {
    color: #003399;
    text-decoration: none;
    transition: color 0.3s;
    line-height: 1;
}

.project-title-link:hover {
    color: #0055CC;
    text-decoration: underline;
}

.project-status-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-weight: 600;
    margin: 1rem 0;
}

.project-status-badge.ongoing {
    background-color: #4CAF50;
    color: white;
}

.project-status-badge.completed {
    background-color: #9E9E9E;
    color: white;
}

.breadcrumb {
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    color: #666;
}

.breadcrumb a {
    color: #003399;
    text-decoration: none;
    line-height: 1;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.public-header {
    background-color: #003399;
    color: white;
    padding: 1.5rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.public-header h1 {
    margin: 0;
    font-size: 1.5rem;
}

.public-header nav {
    display: flex;
    gap: 1.5rem;
    margin-top: 0.5rem;
}

.public-header nav a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.3s;
    line-height: 1;
    text-align: center;
}

.public-header nav a:hover {
    background-color: rgba(255,255,255,0.1);
}

.public-footer {
    background-color: #003399;
    color: white;
    padding: 2rem 0;
    margin-top: 4rem;
    text-align: center;
}

.detail-section .amount {
    color: #003399;
    font-size: 1.1rem;
    font-weight: 600;
}
