/* Base styles */
:root {
    --primary-color: #0ea5e9; /* Button color */
    --primary-hover: #0284c7; /* Button hover color */
    --success-color: #059669;
    --warning-color: #d97706;
    --danger-color: #dc2626;
    --bg-color: #0f172a;
    --sidebar-bg: #1e293b; /* Sidebar background color */
    --card-bg: #1e293b;
    --text-primary: #f8fafc; /* Primary text color */
    --text-secondary: #94a3b8; /* Secondary text color */
    --border-color: #334155; /* Border color */
    --header-bg: #1e293b;
    --glow-color: rgba(14, 165, 233, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--bg-color);
    min-height: 100vh;
    display: flex;
}

/* Sidebar styles */
.sidebar {
    width: 280px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    padding: 2rem 0;
    position: fixed;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    transition: transform 0.3s ease;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.sidebar::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
}

.header-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.header-text h1 {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    color: #fff;
}

.header-text p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
}

.logo-container {
    width: 80px;
    height: 80px;
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    background: transparent;
    flex-shrink: 0;
}

.logo-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 12px;
    background: transparent;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

/* Hide video controls */
video::-webkit-media-controls {
    display: none !important;
}

video::-webkit-media-controls-enclosure {
    display: none !important;
}

/* Hide fallback when video is playing */
.logo-container video.playing + .fallback-logo {
    display: none;
}

/* Show fallback when video fails */
.logo-container video:not(.playing) + .fallback-logo {
    display: block;
    opacity: 1;
}

.logo-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 12px;
    background: transparent;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

.nav-menu {
    padding: 1.5rem 0;
    flex: 1;
}

.nav-item {
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    position: relative;
}

.nav-item:hover, .nav-item.active {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border-left-color: var(--primary-color);
}

.nav-item svg {
    width: 20px;
    height: 20px;
    margin-right: 0.75rem;
    transition: transform 0.2s ease;
}

.nav-item:hover svg {
    transform: scale(1.1);
}

.nav-indicator {
    display: none !important;
}

.sidebar-footer {
    padding: 10px;
    border-top: 1px solid #ddd;
}

.add-balance-container {
    margin-top: 10px;
    background-color: var(--sidebar-bg); /* Match the sidebar background */
    padding: 10px;
    border-radius: 8px; /* Add rounded corners for consistency */
    border: 1px solid var(--border-color); /* Optional: Add a border for separation */
}

.add-balance-container h3 {
    font-size: 16px;
    margin-bottom: 10px;
    color: var(--text-primary); /* Ensure text matches the sidebar */
}

.add-balance-container button {
    display: block;
    width: 100%;
    margin-bottom: 5px;
    padding: 10px;
    font-size: 14px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.add-balance-container button:hover {
    background-color: var(--primary-hover);
}

#manual-pay-section,
#automatic-pay-section {
    margin-top: 10px;
    font-size: 14px;
    color: var(--text-secondary); /* Match the sidebar text color */
}

.connection-status {
    display: none !important;
}

.status-dot {
    display: none !important;
}

.status-text {
    display: none !important;
}

/* Main content */
.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 2rem;
    max-width: calc(100% - 280px);
}

/* Status Overview Section */
.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.status-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.status-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    border-color: var(--primary-color);
}

.status-icon {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-bottom: 1rem;
    position: relative;
}

.status-icon::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.2;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.status-icon.operational {
    background-color: var(--success-color);
    box-shadow: 0 0 0 4px rgba(5, 150, 105, 0.2);
}

.status-icon.maintenance {
    background-color: var(--warning-color);
    box-shadow: 0 0 0 4px rgba(217, 119, 6, 0.2);
}

.status-icon.issue {
    background-color: var(--danger-color);
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.2);
}

.status-card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

/* Updates section styles */
.updates-section {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 2rem;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.updates-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        var(--primary-color) 50%, 
        transparent 100%
    );
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.section-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    position: relative;
}

.header-actions {
    display: flex;
    gap: 1rem;
}

.filter-button {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.filter-button:hover {
    border-color: var(--primary-color);
    color: var(--text-primary);
}

.filter-button svg {
    width: 16px;
    height: 16px;
}

.loading-message {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    margin: 0 auto 1rem;
    animation: spin 1s linear infinite;
}

/* Announcements container */
.updates-container {
    margin-top: 20px;
    padding: 10px;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 5px;
    display: block;
}

/* Announcement container styling */
#updates-container {
    background-color: #ffffff; /* White background for the container */
    padding: 1rem; /* Add padding inside the container */
    border-radius: 8px; /* Rounded corners for the container */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Subtle shadow for depth */
}

/* Individual announcement items */
.update-item {
    margin-bottom: 15px;
    padding: 10px;
    border-bottom: 1px solid #ddd;
}

.update-item h3 {
    margin: 0 0 5px;
    font-size: 18px;
    color: #333;
}

.update-item p {
    margin: 0 0 5px;
    color: #555;
}

.update-item small {
    color: #888;
    font-size: 12px;
}

.update-item {
    display: grid;
    gap: 1.25rem;
}

.update-item {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.1), rgba(14, 165, 233, 0.05));
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.update-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
    border-color: var(--primary-color);
}

.update-card {
    background-color: #f9f9f9; /* Light gray background for readability */
    color: #333; /* Dark text color for contrast */
    padding: 1rem; /* Add padding for spacing */
    margin-bottom: 1rem; /* Add spacing between cards */
    border: 1px solid #ddd; /* Add a border for separation */
    border-radius: 8px; /* Rounded corners for better aesthetics */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Subtle shadow for depth */
    word-break: break-word; /* Ensure long words or URLs wrap properly */
}

.update-item {
    background-color: #f9f9f9; /* Light gray background for readability */
    color: #333; /* Dark text color for contrast */
    padding: 1rem; /* Add padding for spacing */
    margin-bottom: 1rem; /* Add spacing between cards */
    border: 1px solid #ddd; /* Add a border for separation */
    border-radius: 8px; /* Rounded corners for better aesthetics */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Subtle shadow for depth */
    word-break: break-word; /* Ensure long words or URLs wrap properly */
}

.update-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.update-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-right: 1rem;
}

.update-meta {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.update-message {
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 0.9375rem;
}

/* Status badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.375rem 1rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.2s ease;
    min-width: 100px;
    max-width: 150px;
    word-wrap: break-word;
    white-space: normal;
    text-align: center;
    line-height: 1.2;
    margin: 0;
    width: 100%;
}

.status-operational {
    background: rgba(5, 150, 105, 0.2) !important; /* Ensure the background persists */
    color: #34d399;
}

.status-maintenance {
    background: rgba(217, 119, 6, 0.2) !important; /* Ensure the background persists */
    color: #fbbf24;
}

.status-issue {
    background: rgba(220, 38, 38, 0.2) !important; /* Ensure the background persists */
    color: #f87171;
}

/* Quick Actions */
.quick-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.action-button {
    background: var(--card-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.action-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    background: var(--primary-color);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    transition: transform 0.4s ease, opacity 0.3s ease;
}

.action-button:hover::before {
    transform: translate(-50%, -50%) scale(2);
    opacity: 0.1;
}

.action-button.primary {
    border-color: var(--primary-color);
    background: rgba(14, 165, 233, 0.1);
}

.action-button.danger {
    border-color: var(--danger-color);
    background: rgba(220, 38, 38, 0.1);
}

.action-button svg {
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
}

.action-button:hover svg {
    transform: scale(1.1);
}

/* Section controls */
.section-controls {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.section-button {
    background: var(--card-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.section-button:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.announcements-container {
    display: grid;
    gap: 1rem;
    margin-top: 1rem;
}

.announcement {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    transition: all 0.2s ease;
}

.announcement:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.announcement-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.announcement-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.announcement-header .status {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.announcement .date {
    display: block;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

.delete-button {
    background: var(--danger-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 0.5rem;
}

.delete-button:hover {
    background: #b91c1c;
}

/* Hover effect for announcement cards */
.update-card:hover, .update-item:hover {
    background-color: #f0f0f0; /* Slightly darker background on hover */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); /* Enhance shadow on hover */
    transition: all 0.3s ease; /* Smooth transition for hover effect */
}


/* Animations */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.3;
    }
    70% {
        transform: scale(2);
        opacity: 0;
    }
    100% {
        transform: scale(2);
        opacity: 0;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.update-item {
    animation: fadeIn 0.3s ease-out;
}

/* Responsive design */
@media (max-width: 1024px) {
    .sidebar {
        width: 240px;
    }
    
    .main-content {
        margin-left: 240px;
        max-width: calc(100% - 240px);
    }
}

@media (max-width: 768px) {
    body {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        padding: 1rem 0;
    }

    .main-content {
        margin-left: 0;
        max-width: 100%;
        padding: 1.5rem;
    }

    .status-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1rem;
    }

    .updates-section {
        padding: 1.5rem;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .quick-actions {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .sidebar-header h1 {
        font-size: 1.25rem;
    }

    .status-card {
        padding: 1rem;
    }

    .updates-section {
        padding: 1rem;
    }

    .update-header {
        flex-direction: column;
        gap: 0.5rem;
    }

    .status-badge {
        margin-left: 0;
    }
}

.section-button {
    margin: 0 5px;
    padding: 5px 10px;
    border: 1px solid var(--primary-color);
    background: white;
    color: var(--primary-color);
    cursor: pointer;
    border-radius: 3px;
}

.section-button.active {
    background: var(--primary-color);
    color: white;
    font-weight: bold;
}

.section-button:hover {
    background: var(--primary-color-light);
    color: white;
}

/* Remove pagination styles */
.pagination-controls {
    display: none !important;
}

.page-number,
.pagination-btn,
.page-ellipsis {
    display: none !important;
}

/* Update Item Styles */
.update-item {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.1), rgba(14, 165, 233, 0.05));
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.update-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
    border-color: var(--primary-color);
}

.update-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.message-link {
    color: var(--primary-color);
    text-decoration: underline;
    font-weight: 500;
}

.message-link:hover {
    color: var(--primary-hover);
    text-decoration: none;
}

/* Emoji Styling */
.update-title::before {
    font-size: 1.5rem;
    margin-right: 0.5rem;
}

/* Import the Poppins font */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap');

/* Announcements section font styles */
.updates-section h2,
.update-item h3,
.update-item p {
    font-family: 'Poppins', sans-serif; /* Apply the Poppins font */
    font-weight: 600; /* Make it bold */
    letter-spacing: 0.5px; /* Slightly increase letter spacing for readability */
}

.update-item h3 {
    font-size: 1.5rem; /* Increase font size for titles */
    line-height: 1.4; /* Adjust line height */
}

.update-item p {
    font-size: 1rem; /* Set a readable font size for messages */
    line-height: 1.6; /* Adjust line height for better readability */
}

/* Bottom Left Container */
.bottom-left-container {
    position: absolute;
    bottom: 20px; /* Position it at the bottom */
    left: 20px; /* Align it to the left */
    text-align: left;
    border-top: 2px solid var(--border-color); /* Add a line above the button */
    padding-top: 10px; /* Add spacing between the line and the button */
}

.bottom-left-container button {
    padding: 10px 20px;
    font-size: 16px;
    background-color: var(--primary-color); /* Use the primary color */
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.bottom-left-container button:hover {
    background-color: var(--primary-hover); /* Change color on hover */
}