/* Account/Login/Admin Page Specific Styles */

/* Management Console Login Container */
#login-form-container {
    max-width: 400px;
    margin: 100px auto;
    padding: 30px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    text-align: center;
    background-color: rgba(26, 31, 36, 0.85) !important;
}

.admin-panel {
    background-color: rgba(26, 31, 36, 0.85);
    padding: 15px;
    margin-top: 15px;
    border-radius: 6px;
}

.admin-section,
.admin-action-cards > div,
#password-change-card,
#tfa-card,
#generate-license-card {
    background-color: rgba(26, 31, 36, 0.8); /* Consistent background */
    backdrop-filter: blur(5px);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 25px; /* Add padding */
    margin-bottom: 25px; /* Ensure spacing between sections */
    box-shadow: 0 5px 15px rgba(0,0,0,0.15); /* Optional subtle shadow */
}

.admin-section h2,
.admin-action-cards > div h3 {
    margin-top: 0; /* Remove top margin from headers inside styled containers */
    /* padding-bottom: 10px; /* Add padding below header */
    /* border-bottom: 1px solid var(--border-color); /* Optional: Add border below header */
}

.user-table th,
.user-table td {
    padding: 8px;
    font-size: 0.85rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
    max-height: 40px;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
    position: relative;
}

.user-table th {
    font-weight: 600;
    color: rgba(240, 240, 240, 0.8);
}

.action-btns button {
    padding: 4px 8px;
    font-size: 0.75rem;
}

.action-btns button i {
    font-size: 0.8em;
}

.stat-card {
    /* background-color: rgba(0, 0, 0, 0.2); */ /* Old transparent background */
    background-color: rgba(26, 31, 36, 0.8); /* New, more opaque background like glass-card */
    backdrop-filter: blur(5px); /* Add blur effect */
    padding: 12px;
    border-radius: 6px;
    text-align: center;
    border: 1px solid var(--border-color);
    flex: 1;
    min-width: 150px;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease; /* Add transitions */
}

/* Optional: Add a hover effect for stat cards */
.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
    border-color: var(--highlight-color);
}

.stat-card h3 {
    font-size: 0.9rem;
    margin-bottom: 8px;
    color: var(--text-color);
    font-weight: 500;
    opacity: 0.8;
}

.stat-card p {
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

/* Adjust padding/margin for specific forms within admin panel */
#security-settings .form-group,
#security-settings div[style*="margin-bottom"],
#password-change-form div[style*="margin-bottom"] {
     margin-bottom: 10px !important;
}
#security-settings input,
#generate-license-form input,
#generate-license-form select,
#generate-license-form textarea {
    padding: 8px 10px !important;
    font-size: 0.9rem !important;
}
#security-settings button,
#generate-license-form button {
     padding: 8px 18px !important;
     font-size: 0.85rem;
}
#security-settings h3,
#generate-license-form h3 {
    font-size: 1.1rem;
    margin-bottom: 10px;
    grid-column: 1 / -1;
}
 /* Reduce padding on the containers holding the forms */
#security-settings div[style*="padding: 20px"],
#generate-license-form div[style*="padding: 25px"] {
    padding: 15px !important;
}

/* --- Styles for Manual License Generation Form Grid --- */
#generate-license-form {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    align-items: start;
}

/* Make specific divs span both columns */
#generate-license-form > div:nth-last-child(1),
#generate-license-form > div:nth-last-child(2) {
    grid-column: 1 / -1;
}

/* Remove bottom margin from grid items as gap handles spacing */
#generate-license-form > div {
    margin-bottom: 0 !important;
}

/* --- NEW: Widen Account Info Section --- */
#account-info {
    max-width: none; /* Remove max-width restriction */
    /* Add some horizontal padding if needed, but container already has padding */
    /* padding: 0 20px; */ 
}
/* --- END NEW --- */

.search-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
    align-items: center;
}

.search-bar input {
    flex-grow: 1;
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-color);
    color: var(--text-color);
    font-size: 0.9rem;
    line-height: 1.4;
}

.search-bar button {
    padding: 7px 15px;
    font-size: 0.85rem;
    border-radius: 4px;
}

.search-bar .export-btn {
    padding: 7px 12px;
}

.stats-cards {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-start;
}

/* Add some styling for the table headers */
.user-table th {
    font-weight: 600;
}

/* Ensure user table takes full width */
.user-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    min-width: 800px;
}

.user-table th,
.user-table td {
    padding: 8px;
}

/* Wrapper for horizontal scrolling on small screens */
.table-responsive-wrapper {
    overflow-x: auto;
    width: 100%;
    margin-bottom: 15px;
}

/* Custom Scrollbar Styling for the table wrapper */
.table-responsive-wrapper::-webkit-scrollbar {
    height: 8px;
    background-color: rgba(0, 0, 0, 0.1);
}

.table-responsive-wrapper::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 4px;
}

.table-responsive-wrapper::-webkit-scrollbar-thumb:hover {
    background-color: #555;
}

/* Firefox Scrollbar Styling */
.table-responsive-wrapper {
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) rgba(0, 0, 0, 0.1);
}


/* --- Application Version Management (Admin Console) --- */
#app-version-management h3 {
    font-size: 1.1rem;
    margin-top: 15px;
    margin-bottom: 10px;
}

/* Style the upload form container */
#version-upload-form {
}

/* Checkbox styling for version upload form */
#version-upload-form .checkbox-group .checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    margin-bottom: 0;
    font-weight: normal;
    color: var(--text-color);
    gap: 8px;
}

#version-upload-form .checkbox-group input[type="checkbox"] {
    /* The base.css checkbox styles will apply automatically */
    margin: 0;
}

/* Progress Bar Styling */
#version-upload-progress {
    width: 100%;
    margin-top: 15px;
}

#version-upload-progress progress {
    width: 100%;
    height: 10px;
    border-radius: 5px;
    overflow: hidden;
    border: none;
}

/* Basic cross-browser progress bar styling */
#version-upload-progress progress::-webkit-progress-bar {
    background-color: var(--border-color); 
}

#version-upload-progress progress::-webkit-progress-value {
    background-color: var(--highlight-color);
    transition: width 0.3s ease;
}

#version-upload-progress progress::-moz-progress-bar { 
    background-color: var(--highlight-color); 
    border-radius: 5px;
}

#version-upload-progress .progress-text {
    font-size: 0.9em;
    color: var(--text-color);
    margin-top: 5px;
    text-align: center;
}

/* Version Table Specific Styles (inherits .user-table) */
#version-table th,
#version-table td {
    vertical-align: middle;
}

#version-table .action-btns {
    justify-content: flex-start;
}

/* Ensure small buttons have consistent size */
.button-small {
    padding: 4px 10px !important;
    font-size: 0.75rem !important;
}


/* --- Responsive Adjustments for Account/Admin --- */

@media (max-width: 768px) {
    /* --- Manual License Form Grid Fix --- */
     #generate-license-form {
        grid-template-columns: 1fr;
    }

    /* No need to span columns when in single-column layout */
    #generate-license-form > div:nth-last-child(1),
    #generate-license-form > div:nth-last-child(2) {
        grid-column: auto;
    }

     /* Re-add bottom margin for single column layout if needed */
     #generate-license-form > div {
         margin-bottom: 10px !important;
     }
     /* Ensure buttons stack nicely if needed */
     #generate-license-form > div:nth-last-child(1) {
         flex-direction: column;
         gap: 10px;
     }
     #generate-license-form > div:nth-last-child(1) button {
         width: 100%;
     }
    /* --- End Manual License Form Grid Fix --- */

    /* --- Search bar layout fix --- */
    .search-bar {
        flex-wrap: wrap;
        gap: 10px;
    }

    .search-bar input {
        flex-basis: 100%;
        order: 1;
    }

    .search-bar button {
        flex-grow: 1;
        padding: 8px 10px;
        font-size: 0.8rem;
        order: 2;
    }

    .search-bar .export-btn {
        flex-grow: 0;
    }
    /* --- End Search bar layout fix --- */
} 

/* NEW: Styles for inline copy icon in table cells */
.cell-copy-icon {
    cursor: pointer;
    color: var(--highlight-color);
    opacity: 0.7;
    font-size: 0.9em;
    transition: opacity 0.2s ease;
    vertical-align: middle;
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background-color: var(--bg-color);
    padding: 0 3px;
}

.cell-copy-icon:hover {
    opacity: 1;
}

/* Status Indicator Styles */
.status-active {
    color: #28a745; /* Green */
    font-weight: bold;
}
.status-inactive,
.status-expired,
.status-cancelled,
.status-pending,
.status-revoked, /* Added */
.status-unknown {
    color: #ffc107; /* Yellow/Orange for pending/inactive */
    font-style: italic;
}
.status-cancelled,
.status-expired,
.status-revoked { /* Added revoked */
    color: #dc3545; /* Red for cancelled/expired/revoked */
}
.status-revoked { /* More specific style if needed */
    /* You could add a specific background or different shade */
    /* color: #ff8c00; */ /* Example: Dark Orange */
}

/* Add specific styles for account-login.html elements if needed */

/* Ensure email input doesn't look like a dropdown */
#login-form input[type="email"] {
    -webkit-appearance: none; /* Safari/Chrome */
    -moz-appearance: none; /* Firefox */
    appearance: none; /* Standard */
    background-image: none; /* Remove any background arrow image */
    padding-right: 12px; /* Restore padding if arrow removal affected it */
}

/* Style for the main form container */
.form-container {

} 

/* Remove all checkbox-specific styles as they're now in base.css */ 

/* Styling for the Restructured Stats Cards */

.stats-cards {
    align-items: flex-start; /* Align items to the top */
}

/* Make User/License cards narrower */
#total-users-card,
#active-licenses-card {
    flex-grow: 0;
    flex-basis: 180px; /* Adjust width as needed */
    max-width: 200px;
    padding: 15px; /* Adjust padding if needed */
}

#total-users-card h3,
#active-licenses-card h3 {
    font-size: 1.8rem; /* Slightly smaller */
}

/* Make Revenue card wider */
#revenue-overview-card {
    flex-grow: 1; /* Allow it to take more space */
    flex-basis: 400px; /* Minimum width */
    padding: 15px 20px;
    text-align: left; /* Align text left inside */
}

.revenue-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.revenue-card-header p {
    font-size: 0.9rem; /* Match other card titles */
    font-weight: 600;
    margin: 0;
}

a.view-details-link {
    font-size: 0.8em;
    text-decoration: underline;
    color: var(--primary-color);
}
a.view-details-link:hover {
    color: var(--highlight-color);
}

.revenue-main-row,
.revenue-breakdown-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap; /* Allow wrapping on small screens */
    gap: 10px; /* Add gap for wrapping */
}

.revenue-label {
    font-size: 0.9rem;
    color: rgba(240, 240, 240, 0.8);
}

.revenue-value {
    font-size: 1.3rem; /* Main value size */
    font-weight: 600;
    color: var(--text-color);
}

.profit-label {
    margin-left: auto; /* Push profit label to the right */
    padding-left: 20px; /* Add space before profit label */
}

.profit-value {
    font-size: 1.1rem; /* Slightly smaller profit value */
    color: var(--highlight-color); /* Highlight profit */
}

.revenue-breakdown-row {
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px dashed var(--border-color);
    justify-content: flex-start; /* Align breakdown items left */
    gap: 20px; /* Adjust gap between breakdown items */
}

.revenue-breakdown-row .revenue-label {
    font-size: 0.85rem;
}

.revenue-breakdown-row .revenue-value {
    font-size: 1rem;
    font-weight: 500;
}


/* Responsive adjustments for stats cards */
@media (max-width: 900px) { /* Adjust breakpoint as needed */
    #revenue-overview-card {
        flex-basis: 100%; /* Stack revenue card below */
        margin-top: 20px;
    }
    .profit-label {
         margin-left: 0; /* Remove auto margin */
    }
    .revenue-main-row {
        justify-content: space-between; /* Ensure space between on mobile */
    }
}

@media (max-width: 600px) {
    #total-users-card,
    #active-licenses-card,
    #revenue-overview-card {
        flex-basis: 100%; /* Stack all cards */
        max-width: none;
        margin-top: 15px;
    }
    #revenue-overview-card {
        margin-top: 20px;
    }
    .stats-cards > div:first-child {
        margin-top: 0; /* Remove top margin from first card when stacked */
    }
} 

/* Ensure the table/form wrappers don't get double backgrounds */
.table-responsive-wrapper,
#version-upload-form,
#password-change-form,
#tfa-setup,
#tfa-status,
#generate-license-form {
    background-color: transparent !important; /* Override specific backgrounds */
    border: none !important;
    padding: 0 !important;
    box-shadow: none !important;
    margin-bottom: 0 !important; /* Remove bottom margin if it was added by other rules */
}

/* Adjust padding specifically for the upload form container if it was targeted before */
#app-version-management > div[style*="background-color"] {
    background-color: transparent !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    margin-bottom: 0 !important;
}

/* Force container on this page to stretch vertically */
body > .container {
    min-height: 100%;
    display: flex; /* Re-affirm flex properties */
    flex-direction: column;
} 