/* ===== NEW DESIGN - Q4PAY THEME ===== */

/* 1. Import Google Font */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

/* 2. Define Color Palette and Global Styles */
:root {
    --primary-color: #008080; /* A professional teal/green */
    --primary-hover: #006666;
    --background-color: #f0f2f5;
    --container-bg: #ffffff;
    --text-dark: #212529;
    --text-light: #6c757d;
    --border-color: #dee2e6;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--background-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
}

/* 3. Main Container Styling */
.payment-container {
    background-color: var(--container-bg);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    width: 100%;
    max-width: 450px;
    border-top: 5px solid var(--primary-color);
}

h2 {
    text-align: center;
    color: var(--text-dark);
    font-weight: 600;
    margin-top: 0;
    margin-bottom: 30px;
}

p {
    text-align: center;
    color: var(--text-light);
    margin-top: -15px;
    margin-bottom: 25px;
}

/* 4. Form Elements */
.input-group label,
.calculator-box label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-light);
    font-weight: 500;
    font-size: 14px;
}

input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 16px;
    font-family: 'Poppins', sans-serif;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 128, 128, 0.15);
    outline: none;
}

button {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 8px;
    background-color: var(--primary-color);
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
}

button:hover {
    background-color: var(--primary-hover);
}

button:active {
    transform: scale(0.99);
}

/* 5. Logo and Links */
.logo {
    display: block;
    margin: 0 auto 30px auto;
    width: 120px;
    height: auto;
}

.link-container {
    text-align: center;
    margin-top: 25px;
}

.link-container a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.link-container a:hover {
    text-decoration: underline;
}

/* ===== PRICING CALCULATOR STYLES ===== */

.tab-container {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 25px;
}

.tab-button {
    flex: 1;
    padding: 12px 15px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 15px;
    color: var(--text-light);
    font-weight: 500;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease-in-out;
}

.tab-button.active {
    color: var(--primary-color);
    font-weight: 600;
    border-bottom: 3px solid var(--primary-color);
}

.calculator-box {
    background-color: #f8f9fa;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 20px;
}

.calculator-box input {
    font-size: 28px;
    font-weight: 600;
    color: var(--text-dark);
    background: none;
    border: none;
    padding: 0;
}

.separator {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 25px 0;
}

.result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 5px;
    font-size: 16px;
}

.result-row span:last-child {
    font-weight: 600;
    color: var(--text-dark);
}

.result-row.total {
    font-size: 18px;
    font-weight: 700;
    border-top: 2px solid var(--border-color);
    margin-top: 10px;
    padding-top: 15px;
}

.tab-content {
    background-color: #f8f9fa;
    border: 1px solid var(--border-color);
    border-top: none;
    padding: 10px 20px 15px 20px;
    margin-top: -25px;
    margin-bottom: 25px;
    border-radius: 0 0 8px 8px;
}

.tab-content p {
    font-weight: 600;
    color: var(--text-dark);
    text-align: left;
    margin-bottom: 10px;
}

.tab-content ul {
    list-style-type: '✓  ';
    padding-left: 20px;
    margin: 0;
    color: var(--text-light);
    font-size: 14px;
}

.tab-content ul li {
    padding-bottom: 8px;
}

.error-message {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 20px;
    text-align: center;
    display: none; /* Hidden by default */
}

/* Transaction Table Styles */
.transaction-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.transaction-table th, .transaction-table td {
    padding: 12px 10px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.transaction-table th {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-light);
}

.transaction-table td {
    font-size: 14px;
    color: var(--text-dark);
}

.status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
}

.status-badge.successful {
    background-color: #d4edda;
    color: #155724;
}

.status-badge.failed {
    background-color: #f8d7da;
    color: #721c24;
}

.nav-link {
    font-size: 14px;
    text-decoration: none;
    color: var(--primary-color);
    font-weight: 500;
}

/* ===== DASHBOARD LAYOUT STYLES ===== */

.dashboard-layout {
    display: flex;
    background-color: var(--background-color);
    width: 100vw;
    height: 100vh;
}

.sidebar {
    width: 250px;
    background-color: var(--container-bg);
    padding: 30px 20px;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
}

.sidebar .logo {
    width: 100px;
    margin-bottom: 40px;
}

.sidebar-nav a {
    display: block;
    padding: 15px 20px;
    margin-bottom: 10px;
    text-decoration: none;
    color: var(--text-light);
    font-weight: 500;
    border-radius: 8px;
    transition: background-color 0.2s, color 0.2s;
}

.sidebar-nav a.active,
.sidebar-nav a:hover {
    background-color: var(--primary-color);
    color: #ffffff;
}

.logout-section {
    margin-top: auto; /* Pushes logout to the bottom */
}

.main-content {
    flex: 1;
    padding: 40px;
    overflow-y: auto; /* Makes content scrollable */
}

.main-content h2 {
    text-align: left;
    font-size: 28px;
    margin-bottom: 10px;
}

.main-content h3 {
    text-align: left;
    font-size: 20px;
    margin-top: 30px;
    color: var(--text-dark);
}

.stat-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.stat-card {
    background-color: var(--container-bg);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.stat-card h4 {
    margin: 0 0 10px 0;
    color: var(--text-light);
    font-size: 14px;
    font-weight: 500;
}

.stat-card p {
    margin: 0;
    text-align: left;
    color: var(--text-dark);
    font-size: 28px;
    font-weight: 600;
}

/* Profile Page Styles */
.profile-details {
    margin-top: 20px;
}
.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
}
.detail-row:last-child {
    border-bottom: none;
}
.detail-row span:first-child {
    color: var(--text-light);
}
.detail-row span:last-child {
    font-weight: 500;
    color: var(--text-dark);
}

/* ===== UI ENHANCEMENT STYLES ===== */

/* Loading Spinner */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

/* Replace the old .spinner rule with this */
.spinner {
    width: 60px; /* Adjust size as needed */
    height: 60px;
    background-image: url('logo.png'); /* Assumes your logo is named this */
    background-size: contain;
    background-repeat: no-repeat;
    animation: spin 1.5s linear infinite;
}

/* Replace the old @keyframes rule with this */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Notification Pop-up */
.notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 15px 25px;
    border-radius: 8px;
    color: #fff;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s, bottom 0.3s;
    z-index: 1001;
}

.notification.show {
    opacity: 1;
    visibility: visible;
    bottom: 30px;
}

.notification.success {
    background-color: var(--primary-color);
}

.notification.error {
    background-color: #dc3545; /* A standard red color for errors */
}

/* ===== MOBILE & TABLET RESPONSIVE STYLES ===== */

/* --- For Tablets (and smaller desktops) --- */
@media (max-width: 1024px) {
    .sidebar {
        width: 220px; /* Make the sidebar a bit smaller */
    }
    .main-content {
        padding: 30px;
    }
}

/* --- For Mobile Phones --- */
@media (max-width: 768px) {
    body {
        /* Remove center alignment for a top-down layout on mobile */
        align-items: flex-start;
        height: auto; /* Allow body to grow with content */
    }

    .dashboard-layout {
        /* Change from a row (sidebar + content) to a column */
        flex-direction: column;
        height: 100%;
        width: 100%;
    }

    .sidebar {
        width: 100%;
        box-shadow: none;
        padding: 15px;
        flex-direction: row; /* Arrange items horizontally */
        align-items: center;
        justify-content: space-between;
        border-bottom: 1px solid var(--border-color);
        height: auto;
    }

    .sidebar .logo {
        width: 80px;
        margin: 0;
    }

    .sidebar-nav {
        display: flex; /* Make nav items horizontal */
    }

    .sidebar-nav a {
        padding: 8px 12px;
        margin: 0 5px;
    }

    .logout-section {
        margin-top: 0; /* Reset margin */
    }

    .main-content {
        padding: 20px;
    }

    .payment-container {
        padding: 20px;
        box-shadow: none; /* Remove shadow for a flatter look */
    }

    h2 {
        font-size: 24px;
    }
}

/* CAC Verification Status Styles */
.cac-status {
    font-size: 14px;
    margin-top: 10px;
    padding: 8px;
    border-radius: 6px;
    font-weight: 500;
}
.cac-status.success {
    color: #155724;
    background-color: #d4edda;
}
.cac-status.error {
    color: #721c24;
    background-color: #f8d7da;
}

.notification.info {
    background-color: #17a2b8; /* A nice blue/teal for info */
}

/* Styles for Admin Controls */
.admin-controls {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}
.admin-controls input {
    padding: 8px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}
.pagination-controls {
    margin-top: 20px;
    text-align: center;
}
.pagination-controls button {
    width: auto;
    padding: 8px 16px;
    margin: 0 10px;
}
.pagination-controls button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* Integration Page Styles */
.snippet-container {
    position: relative;
    background-color: #2d2d2d; /* Dark background */
    border-radius: 8px;
    margin-top: 20px;
    padding: 20px;
    overflow-x: auto;
}

.snippet-container pre {
    margin: 0;
}

.snippet-container code {
    font-family: 'Courier New', Courier, monospace;
    color: #e0e0e0; /* Light text */
    font-size: 14px;
    white-space: pre-wrap;
    word-break: break-all;
}

.copy-button {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 6px 12px;
    font-size: 12px;
    background-color: #555;
    border: none;
    border-radius: 6px;
    color: white;
    cursor: pointer;
    transition: background-color 0.2s;
}

.copy-button:hover {
    background-color: var(--primary-color);
}

/* Developer Page Styles */
.api-key-display {
    margin-bottom: 15px;
}
.api-key-display label, #secret-key-section label {
    font-weight: 500;
    color: var(--text-dark);
    display: block;
    margin-bottom: 5px;
}
.api-key-display input, #secret-key-section input {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: #f9f9f9;
}