/* --- BACKGROUND IMAGE --- */
body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f4;
    margin: 0;
    padding: 20px;

    /* ADD THESE LINES for background image */
    background-image: url('../img/background.jpg'); /* Path to your background image */
    background-size: cover; /* Cover the entire viewport */
    background-position: center; /* Center the image */
    background-repeat: no-repeat; /* Do not repeat the image */
    background-attachment: fixed; /* Keep image fixed when scrolling */
}

/* ========================================================= */
/* --- GENERAL CONTAINER STYLES (Adjusted for better contrast with background) --- */
.container {
    background-color: rgba(255, 255, 255, 0.9); /* Semi-transparent white background for content */
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2); /* Stronger shadow for separation */
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
}

.auth-container {
    max-width: 450px; /* Slightly wider for better form appearance */
    margin: 50px auto;
    text-align: center;
}

/* ========================================================= */
/* --- LOGO STYLES --- */
.app-logo {
    display: block; /* Makes it take its own line */
    max-width: 350px; /* Adjust max-width as needed */
    height: auto; /* Maintain aspect ratio */
    margin: 0 auto 25px auto; /* Center it horizontally, add space below */
}

h2 {
    color: #333;
    margin-bottom: 20px;
    text-align: center; /* Keep headings centered if desired */
}

/* ... Rest of your CSS (p, .message, etc.) ... */

form {
    margin-top: 20px;
    text-align: left;
    margin-bottom: 20px; /* Added margin-bottom here */
}

label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: bold;
}

/* Combined selector for all inputs, textareas, and selects */
input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select { /* Note: input[type="file"] is now separate below */
    width: 100%; /* Use 100% with box-sizing: border-box */
    padding: 10px;
    margin-bottom: 15px; /* Consistent spacing */
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box; /* Crucial for width: 100% to work with padding */
    font-size: 16px;
    background-color: #fff;
    display: block; /* Ensure they take up full lines */
}

/* Explicitly target input type="file" for consistent block-level display and margin */
input[type="file"] {
    display: block; /* Make sure it behaves as a block element */
    width: 100%; /* Ensure it tries to take full width */
    margin-bottom: 15px; /* Add the consistent margin-bottom */
    box-sizing: border-box; /* Important for width calculation with padding */
    padding: 10px 0; /* Add some vertical padding, but usually no horizontal padding on the file input itself */
    font-size: 16px; /* Consistent font size */
}

button[type="submit"] {
    background-color: #007bff;
    color: white;
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    text-decoration: none; /* For link styling */
    display: inline-block; /* For link styling */
    margin-top: 10px; /* Space it from other elements */
    transition: background-color 0.3s ease;
}

button[type="file"] {
    background-color: #007bff;
    color: white;
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    text-decoration: none; /* For link styling */
    display: inline-block; /* For link styling */
    margin-top: 10px; /* Space it from other elements */
    transition: background-color 0.3s ease;
}

.group-actions .btn { /* Generic style for dashboard buttons */
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    text-decoration: none;
    display: inline-block;
    transition: background-color 0.3s ease;
    color: white; /* Default text color for buttons */
}
.group-actions .btn-primary {
    background-color: #007bff;
}
.group-actions .btn-primary:hover {
    background-color: #0056b3;
}
.group-actions .btn-danger {
    background-color: #dc3545;
}
.group-actions .btn-danger:hover {
    background-color: #c82333;
}
.group-actions .btn-secondary {
    background-color: #007bff;
}
.group-actions .btn-secondary:hover {
    background-color: #0056b3;
}

.credit-display {
    text-align: right;
    font-weight: bold;
    font-size: 1.1em;
    color: #007bff;
    margin-bottom: 15px;
}
.action-cost {
    font-size: 0.8em;
    color: #6c757d;
    margin-left: 5px;
}

/* New styles for Buy Credits page */
.credit-package-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-top: 20px;
    margin-bottom: 30px;
}
.credit-package {
    background-color: #f0f8ff;
    border: 1px solid #cceeff;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}
.credit-package:hover {
    background-color: #e6f7ff;
    border-color: #99ddff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
.credit-package.selected {
    background-color: #007bff;
    color: white;
    border-color: #0056b3;
    box-shadow: 0 6px 12px rgba(0,0,0,0.2);
    transform: translateY(-3px);
}
.credit-package h4 {
    margin-top: 0;
    color: inherit;
}
.credit-package p {
    font-size: 1.2em;
    font-weight: bold;
    color: inherit;
}
.credit-package .amount-display {
    font-size: 0.9em;
    color: inherit;
}
.payment-methods {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.stripe-button, .paypal-button {
    width: 100%;
    height: 48px;
    line-height: 48px;
    font-size: 1.1em;
    font-weight: bold;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    color: white;
    text-align: center;
    text-decoration: none;
    display: block;
}
.stripe-button {
    background-color: #6772e5; /* Stripe's primary color */
}
.stripe-button:hover {
    background-color: #5469d4;
}
#paypal-button-container {
    width: 100%;
}
.message.success {
    background-color: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}
.message.error {
    background-color: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

hr {
    border: 0;
    height: 1px;
    background: #ccc;
    margin: 30px 0; /* Adjust margin for hr as needed */
}

a {
    color: #007bff;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

img[alt="QR Code for 2FA"] {
    display: block;
    margin: 20px auto;
    border: 1px solid #eee;
    padding: 5px;
    background-color: #fff;
}

/* --- GENERAL FORM INPUT STYLES --- */
/* Apply to inputs and textareas generally, but with a reduced width */
input[type="text"],
input[type="email"],
input[type="password"],
textarea {
    width: calc(80% - 20px); /* Reduced width, adjust as needed */
    padding: 8px; /* Slightly smaller padding */
    margin-bottom: 10px; /* Reduced margin */
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 15px; /* Slightly smaller font */
    display: block;
}

select { /* Keep select at 100% or adjust if needed */
    width: 100%;
    padding: 8px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 15px;
    background-color: #fff;
    display: block;
}

/* Specific adjustments for the create group form inside category */
.create-group-form-category {
    /* ... (existing styles) ... */
}
.create-group-form-category input[type="text"],
.create-group-form-category textarea,
.create-group-form-category button {
    margin-bottom: 8px; /* Slightly less margin than main forms */
    padding: 6px; /* Even smaller padding */
    font-size: 0.85em; /* Smaller font */
    width: calc(100% - 12px); /* Adjust width for padding */
}
.create-group-form-category button {
    width: auto;
    padding: 8px 15px;
    margin-top: 5px;
    font-size: 0.9em; /* Match action buttons */
}
.create-group-form-category label {
    font-size: 0.85em; /* Match inputs */
}

/* ... (all existing styles) ... */

/* --- Account Dropdown Styles --- */
.credit-display-wrapper {
    display: flex;
    justify-content: flex-end; /* Push to the right */
    align-items: center;
    gap: 15px; /* Space between credits and account icon */
    margin-bottom: 15px;
}
.credit-display { /* Adjusted to fit into flex container */
    font-weight: bold;
    font-size: 1.1em;
    color: #007bff;
    margin-bottom: 0;
}
.account-dropdown {
    position: relative;
    display: inline-block;
}
.account-icon-btn {
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 50%; /* Circle shape */
    width: 40px;
    height: 40px;
    font-size: 1.2em;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: background-color 0.3s ease;
}
.account-icon-btn:hover {
    background-color: #0056b3;
}
.dropdown-content {
    display: none;
    position: absolute;
    background-color: #f9f9f9;
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1; /* Ensure it appears above other content */
    border-radius: 5px;
    right: 0; /* Align dropdown to the right of the button */
    margin-top: 5px;
}
.dropdown-content a {
    color: black;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    text-align: left;
    font-size: 0.95em;
}
.dropdown-content a:hover {
    background-color: #f1f1f1;
    border-radius: 5px;
}
.dropdown-content .dropdown-header {
    padding: 12px 16px;
    font-weight: bold;
    border-bottom: 1px solid #eee;
    color: #555;
    font-size: 0.9em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.account-dropdown.show .dropdown-content {
    display: block;
}

/* --- Settings Page Specific Styles (for settings.php) --- */
.settings-section {
    background-color: #f8f8f8;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
    text-align: left; /* Align text left within settings sections */
}
.settings-section h3 {
    color: #007bff;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
    margin-bottom: 15px;
    font-size: 1.1em;
    text-align: left; /* Ensure heading is left-aligned */
}
.settings-section p {
    margin-bottom: 10px;
    color: #333;
}
.settings-section form {
    margin-top: 15px;
    text-align: left; /* Keep form elements left-aligned */
}
.settings-section input[type="text"] {
    max-width: 250px; /* Limit width for settings inputs */
}
.settings-section button {
    width: auto;
    padding: 8px 15px;
    margin-top: 10px;
}