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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Navigation */
.navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.navbar-logo {
    height: 80px;
    width: auto;
    object-fit: contain;
}

.navbar-text {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.navbar-credit {
    font-size: 0.65rem;
    font-weight: normal;
    opacity: 0.9;
    letter-spacing: 0.5px;
}

.navbar-menu {
    display: flex;
    gap: 1rem;
}

/* Service Tabs */
.navbar-service-tabs {
    display: flex;
    gap: 0.5rem;
    flex: 1;
    justify-content: center;
}

.service-tab {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid transparent;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s;
}

.service-tab:hover {
    background: rgba(255, 255, 255, 0.3);
}

.service-tab.active {
    background: white;
    color: #667eea;
    border-color: white;
}

/* Pages */
.page {
    flex: 1;
    display: flex;
    transition: opacity 0.3s;
}

.page.hidden {
    display: none;
}

/* Login Form */
#loginForm {
    justify-content: center;
    align-items: center;
}

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

.login-box h1 {
    margin-bottom: 2rem;
    text-align: center;
    color: #667eea;
}

.login-box form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.login-box input {
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

.login-box input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 5px rgba(102, 126, 234, 0.3);
}

.error {
    color: #e74c3c;
    margin-top: 0.5rem;
}

/* Dashboard Layout */
#dashboardPage {
    display: flex;
    flex: 1;
}

.sidebar {
    width: 200px;
    background: #f8f9fa;
    padding: 2rem 0;
    border-right: 1px solid #ddd;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-btn {
    background: none;
    border: none;
    padding: 1rem 1.5rem;
    text-align: left;
    cursor: pointer;
    font-size: 1rem;
    color: #666;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.nav-btn:hover {
    background: #e9ecef;
    color: #667eea;
}

.nav-btn.active {
    background: #e7f0ff;
    color: #667eea;
    border-left-color: #667eea;
    font-weight: bold;
}

.main-content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

/* Tabs */
.tab-content {
    display: none;
}

.tab-content.active {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    animation: fadeIn 0.3s;
}

/* Accounting tabs use block display for iframes */
#accountingPortalTab.active,
#accountingDashboardTab.active {
    display: block !important;
    height: calc(100vh - 200px) !important;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

h2 {
    margin-bottom: 1.5rem;
    color: #333;
}

/* Upload Form */
.upload-form {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 10px;
    max-width: 600px;
}

.upload-area {
    border: 3px dashed #667eea;
    border-radius: 8px;
    padding: 3rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: white;
}

.upload-area:hover {
    border-color: #764ba2;
    background: #f8f9fa;
}

.upload-area.dragover {
    background: #e7f0ff;
    border-color: #764ba2;
}

.image-preview {
    margin-top: 1rem;
    position: relative;
}

.image-preview.hidden {
    display: none;
}

.image-preview img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
}

.form-group {
    margin-top: 1.5rem;
}

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

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: inherit;
    font-size: 1rem;
}

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

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 5px rgba(102, 126, 234, 0.3);
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    color: #666;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    background: #667eea;
    color: white;
}

.btn-small:hover {
    background: #764ba2;
}

/* Posts List */
.filter-buttons {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    background: white;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

.filter-btn:hover {
    border-color: #667eea;
}

.filter-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.posts-list {
    display: grid;
    gap: 1rem;
}

.post-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s;
}

.post-card:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
}

.post-image {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 5px;
}

.post-status {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-scheduled {
    background: #d1ecf1;
    color: #0c5460;
}

.status-posted {
    background: #d4edda;
    color: #155724;
}

.status-failed {
    background: #f8d7da;
    color: #721c24;
}

.post-time {
    color: #666;
    font-size: 0.9rem;
}

.post-description {
    margin: 0.5rem 0;
    color: #333;
    max-height: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.95rem;
    opacity: 0.9;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.hidden {
    display: none !important;
}

.modal:not(.hidden) {
    display: flex !important;
}

.modal-content {
    background: white;
    border-radius: 10px;
    padding: 2rem;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
}

.modal-close:hover {
    color: #333;
}

/* Responsive */
@media (max-width: 768px) {
    #dashboardPage {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        padding: 1rem;
        flex-direction: row;
        overflow-x: auto;
        border-right: none;
        border-bottom: 1px solid #ddd;
    }

    .nav-btn {
        padding: 0.5rem 1rem;
        white-space: nowrap;
        border-left: none;
        border-bottom: 3px solid transparent;
    }

    .nav-btn.active {
        border-left: none;
        border-bottom-color: #667eea;
    }

    .main-content {
        padding: 1rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .upload-area {
        padding: 2rem 1rem;
    }
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.success {
    color: #155724;
    background: #d4edda;
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 1rem;
}
