/* Existing styles remain unchanged unless specified */
html {
    font-size: 14px !important;
}
body {
    font-family: 'Inter', sans-serif;
    background: #f1f5f1;
    color: #1e293b;
    margin: 0;
    line-height: 1.6;
    font-size: 1rem;
}
/* Reset default <a> hover to prevent blue text */
a:hover {
    color: inherit !important;
    text-decoration: none !important;
}
.container {
    padding: 0;
    margin: 0;
    max-width: 100%;
    width: 100%;
}
.header {
    background: linear-gradient(135deg, #85A385, #5A765A);
    color: white;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    flex-wrap: wrap;
}
.header h2 {
    margin: 0;
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    font-weight: 700;
}
.header-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}
.header-button {
    padding: 8px 16px;
    background-color: #4A7043;
    color: white !important;
    border: none;
    border-radius: 6px;
    text-decoration: none !important;
    font-size: 0.95rem;
    font-weight: 500;
    transition: background-color 0.3s ease, transform 0.2s ease, color 0.3s ease;
    cursor: pointer;
    margin-left: 12px;
}
/* High-specificity rule to override inline styles */
a.header-button:hover, .header a.header-button:hover, .header-buttons a.header-button:hover {
    background-color: #3A5A34 !important;
    color: white !important;
    transform: translateY(-1px) !important;
}
.header-button:active {
    transform: translateY(0);
}
.logout-button {
    background-color: #4A7043;
}
.logout-button:hover, a.logout-button:hover, .header a.logout-button:hover, .header-buttons a.logout-button:hover {
    background-color: #3A5A34 !important;
    color: white !important;
}
/* Global fallback for <a> elements styled as buttons */
a[class*="btn"], a.header-button, a.logout-button {
    color: inherit !important;
    text-decoration: none !important;
}
a[class*="btn"]:hover, a.header-button:hover, a.logout-button:hover {
    color: white !important;
}
.btn-primary, .btn-share, .btn-copy {
    background: #2f855a;
    color: white !important;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: background 0.3s ease, transform 0.2s ease, color 0.3s ease;
    margin: 6px;
}
.btn-secondary {
    background: #6b7280;
    color: white !important;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: background 0.3s ease, transform 0.2s ease, color 0.3s ease;
    margin: 6px;
}
.btn-primary:hover, .btn-secondary:hover, .btn-share:hover, .btn-copy:hover {
    background: #48bb78;
    color: white !important;
    transform: translateY(-1px);
}
.pagination {
    margin: 20px 0;
    text-align: center;
}
.pagination a {
    margin: 0 6px;
    padding: 8px 14px;
    background: #2f855a;
    color: white !important;
    text-decoration: none !important;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: background 0.3s ease, transform 0.2s ease, color 0.3s ease;
}
.pagination a:hover {
    background: #48bb78;
    color: white !important;
    transform: translateY(-1px);
}
.pagination span {
    margin: 0 6px;
    font-weight: 500;
    color: #1e293b;
}
.messages {
    list-style: none;
    padding: 0;
    margin: 16px 0;
}
.messages li {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 8px;
    font-size: 0.95rem;
    font-weight: 500;
}
.messages .success { background: #dcfce7; color: #166534; }
.messages .error { background: #fee2e2; color: #991b1b; }
.messages .warning { background: #fef9c3; color: #854d0e; }
.messages .info { background: #e0f2fe; color: #075985; }
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 1050;
}
.modal.show {
    display: block;
}
.modal-dialog {
    max-width: 550px;
    margin: 120px auto;
}
.modal-content {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 8px 28px rgba(0,0,0,0.2);
}
.modal-header, .modal-footer {
    border: none;
    padding: 12px 0;
}
.modal-title {
    font-family: 'Playfair Display', serif;
    color: #2f855a;
    font-size: 1.5rem;
}
.content {
    max-width: 1280px;
    margin: 24px auto;
    padding: 0 16px;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}
.content.loaded {
    opacity: 1;
    transform: translateY(0);
}
.card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
    padding: 24px;
    margin-bottom: 24px;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid #68d391;
}
.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}
.card h3, .highlighted-heading {
    font-family: 'Playfair Display', serif;
    color: #2f855a;
    margin-bottom: 16px;
    font-size: 1.75rem;
    font-weight: 700;
}
.highlighted-heading {
    background: linear-gradient(135deg, #c6f6d5, #9ae6b4);
    color: #1e293b;
    border: 1px solid #68d391;
    padding: 10px 16px;
    border-radius: 8px;
    display: inline-block;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
}
.metrics-table {
    width: 100%;
    border-collapse: collapse;
    background: linear-gradient(180deg, #f0fdf4, #dcfce7);
    border: 1px solid #68d391;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}
.metrics-table th, .metrics-table td {
    border: 1px solid #68d391;
    padding: 14px;
    text-align: center;
    font-size: 0.95rem;
    font-weight: 400;
}
.metrics-table th {
    background: #68d391;
    color: #1e293b;
    font-weight: 600;
}
.metrics-table tr:hover {
    background: #d1fae5;
}
.credentials-table-container {
    flex: 0.6;
    min-width: 200px;
}
.credentials-table-container .metrics-table {
    background: linear-gradient(180deg, #f0fdf4, #dcfce7);
    border: 1px solid #68d391;
    color: #1e293b;
}
.credentials-table-container .metrics-table td, 
.credentials-table-container .metrics-table th {
    border: 1px solid #68d391;
    padding: 10px;
}
.credentials-table-container .metrics-table td a {
    display: inline-block;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #2f855a;
    transition: color 0.3s;
}
.credentials-table-container .metrics-table td a:hover {
    color: #48bb78 !important;
}
.credentials-table-container .metrics-table td button {
    margin-top: 5px;
    padding: 6px 12px;
    font-size: 0.85rem;
}
.credentials-table-container .highlighted-heading {
    background: linear-gradient(135deg, #c6f6d5, #9ae6b4);
    border: 1px solid #68d391;
}
.sales-table-container {
    flex: 1.4;
    min-width: 400px;
}
.referrals-table {
    width: 100%;
    border-collapse: collapse;
    background: linear-gradient(180deg, #f0fdf4, #dcfce7);
    border: 1px solid #68d391;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}
.referrals-table th, .referrals-table td {
    border: 1px solid #68d391;
    padding: 12px;
    text-align: center;
    font-size: 0.95rem;
}
.referrals-table tr:hover {
    background: #d1fae5;
}
.referrals-table-container .highlighted-heading {
    background: linear-gradient(135deg, #c6f6d5, #9ae6b4);
    border: 1px solid #68d391;
}
.popup {
    background: #fee2e2;
    padding: 16px;
    border-radius: 8px;
    margin: 16px 0;
    text-align: center;
    color: #991b1b;
    font-weight: 500;
}
.popup a {
    color: #2f855a;
    font-weight: 600;
    text-decoration: underline;
    transition: color 0.3s;
}
.popup a:hover {
    color: #48bb78 !important;
}
.referral-code {
    display: inline-block;
    padding: 10px 20px;
    background: #f0fdf4;
    border: 1px solid #68d391;
    border-radius: 6px;
    margin: 12px 0;
    font-weight: 500;
    color: #1e293b;
}
.side-by-side {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}
.side-by-side > div {
    min-width: 0;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
@media (max-width: 768px) {
    .container {
        width: 100%;
    }
    .header {
        flex-direction: column;
        gap: 10px;
        padding: 10px;
    }
    .header h2 {
        font-size: 1.6rem;
    }
    .header-buttons {
        justify-content: center;
        flex-wrap: wrap;
    }
    .header-button {
        padding: 6px 12px;
        font-size: 0.9rem;
        margin-left: 8px;
    }
    .modal-dialog {
        margin: 80px 16px;
        max-width: 100%;
    }
    .content {
        padding: 0 12px;
    }
    .card {
        padding: 16px;
    }
    .metrics-table th, .metrics-table td, .referrals-table th, .referrals-table td {
        padding: 10px;
        font-size: 0.85rem;
    }
    .side-by-side {
        flex-direction: column;
        gap: 12px;
    }
    .side-by-side > div {
        min-width: 100%;
    }
    .highlighted-heading {
        font-size: 1rem;
    }
}
.header-button:hover {
    color: white !important; /* Fallback, but already handled by a:hover */
}

/* Refine for socialaccount/connections.html */
html body .container .card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
    padding: 24px;
    margin: 24px auto;
    max-width: 500px;
    border: 1px solid #68d391;
}
html body .container .card h3.highlighted-heading {
    background: linear-gradient(135deg, #c6f6d5, #9ae6b4);
    color: #1e293b;
    border: 1px solid #68d391;
    padding: 10px 16px;
    border-radius: 8px;
    font-family: 'Playfair Display', serif;
    font-size: 1.75rem;
    font-weight: 700;
    text-align: center;
}
html body .container .card p {
    color: #1e293b;
    font-size: 1rem;
    margin-bottom: 20px;
    text-align: center;
}
html body .container .card form {
    text-align: center;
}
html body .container .card .btn-primary {
    background: #2f855a;
    color: white !important;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: background 0.3s ease;
}
html body .container .card .btn-primary:hover {
    background: #48bb78;
    color: white !important;
}
html body .container .card .btn-secondary {
    background: #6b7280;
    color: white !important;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    margin-left: 10px;
    text-decoration: none !important;
    display: inline-block;
}
html body .container .card .btn-secondary:hover {
    background: #4b5563;
    color: white !important;
}

/* New rule to ensure input visibility */
.form-control {
    color: #1e293b !important; /* Matches body text color for contrast */
    background-color: #fff !important; /* Ensures white background */
    border: 1px solid #2A6A5A !important; /* Matches inline style */
    border-radius: 3px !important;
    padding: 8px !important;
    width: 100% !important;
    font-size: 1rem !important;
    transition: border-color 0.3s ease !important;
}
.form-control:focus {
    border-color: #2f855a !important;
    outline: none !important;
    box-shadow: 0 0 5px rgba(47, 133, 90, 0.5) !important;
}
