/* ExactLeader Universal CSS */

/* Global Styles */
body {
    margin: 0;
    padding: 0;
}

.is-hidden {
    display: none !important;
}

.bg {
    background-color: #f2f2f2;
    min-height: 100vh;
    padding-top: 50px;
}

/* Dashboard specific background */
.bg.dashboard {
    padding: 0;
    margin: 0;
    font-family: Arial, Verdana, sans-serif;
}

/* Typography */
.title {
    font-family: Arial, Verdana, sans-serif;
    font-size: 24px;
    text-align: center;
    width: 100%;
    margin-bottom: 10px;
}

.title.dashboard {
    font-weight: bold;
    color: #333;
}

.instructions {
    font-family: Arial, Verdana, sans-serif;
    font-size: 16px;
    text-align: center;
    margin-top: 20px;
    margin-bottom: 30px;
    width: 100%;
    color: #666;
}

/* Form Elements */
.form-input {
    display: block;
    margin: 15px auto;
    width: 300px;
    padding: 12px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-family: Arial, Verdana, sans-serif;
}

.form-input:focus {
    outline: none;
    border-color: #367AF6;
    box-shadow: 0 0 0 2px rgba(54, 122, 246, 0.2);
}

.email-input {
    display: flex;
    margin-left: auto;
    margin-right: auto;
    justify-content: center;
    margin-top: 20px;
}

/* Buttons */
.button-10 {
    margin-top: 20px;
    margin-left: auto;
    margin-right: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 24px;
    font-family: -apple-system, BlinkMacSystemFont, 'Roboto', sans-serif;
    border-radius: 6px;
    border: none;
    font-size: 16px;
    cursor: pointer;
    color: #fff;
    background: linear-gradient(180deg, #4B91F7 0%, #367AF6 100%);
    background-origin: border-box;
    box-shadow: 0px 0.5px 1.5px rgba(54, 122, 246, 0.25), inset 0px 0.8px 0px -0.25px rgba(255, 255, 255, 0.2);
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    transition: all 0.2s ease;
}

.button-10:hover {
    background: linear-gradient(180deg, #5BA0F8 0%, #4785F7 100%);
}

.button-10:focus {
    box-shadow: inset 0px 0.8px 0px -0.25px rgba(255, 255, 255, 0.2), 0px 0.5px 1.5px rgba(54, 122, 246, 0.25), 0px 0px 0px 3.5px rgba(58, 108, 217, 0.5);
    outline: 0;
}

.button-10:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Dashboard button variations */
.button-10.dashboard {
    margin: 0;
    padding: 10px 20px;
    font-size: 14px;
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
}

.button-10.secondary {
    background: linear-gradient(180deg, #6c757d 0%, #5a6268 100%);
    box-shadow: 0px 0.5px 1.5px rgba(108, 117, 125, 0.25), inset 0px 0.8px 0px -0.25px rgba(255, 255, 255, 0.2);
}

.button-10.secondary:hover {
    background: linear-gradient(180deg, #7c848b 0%, #6c757d 100%);
}

.exact-oauth-btn {
    background: linear-gradient(180deg, #28a745 0%, #20883d 100%);
    box-shadow: 0px 0.5px 1.5px rgba(40, 167, 69, 0.25), inset 0px 0.8px 0px -0.25px rgba(255, 255, 255, 0.2);
}

.exact-oauth-btn:hover {
    background: linear-gradient(180deg, #34ce57 0%, #28a745 100%);
}

.teamleader-oauth-btn {
    background: linear-gradient(180deg, #007bff 0%, #0056b3 100%);
    box-shadow: 0px 0.5px 1.5px rgba(0, 123, 255, 0.25), inset 0px 0.8px 0px -0.25px rgba(255, 255, 255, 0.2);
}

.teamleader-oauth-btn:hover {
    background: linear-gradient(180deg, #0d7af4 0%, #007bff 100%);
}

/* Delete page specific button */
.button-10.delete {
    margin-top: 40px;
    padding: 6px 14px;
}

/* Loading spinner styles */
.loading-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
    display: inline-block;
}

.button-10.loading {
    pointer-events: none;
    opacity: 0.7;
}

.button-10.loading .button-text {
    opacity: 0.7;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.logout-btn {
    margin-left: 40px;
    background-color: #ff6b6b;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s ease;
}

.logout-btn:hover {
    background-color: #ff5252;
}

.page-loader {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #f2f2f2;
    z-index: 999;
    color: #333;
    gap: 12px;
}

.page-loader.is-hidden {
    display: none !important;
}

.page-loader__spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(54, 122, 246, 0.15);
    border-top-color: #367AF6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.page-loader__text {
    font-size: 16px;
    font-family: Arial, Verdana, sans-serif;
    color: #333;
}

.dashboard-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Messages */
.error-message {
    background-color: #fee;
    color: #c33;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #fcc;
    margin: 15px auto;
    width: 300px;
    text-align: center;
    font-family: Arial, Verdana, sans-serif;
    font-size: 14px;
}

.loading-message {
    color: #4B91F7;
    margin: 15px auto;
    width: 300px;
    text-align: center;
    font-family: Arial, Verdana, sans-serif;
    font-size: 14px;
}

/* Links */
.login-link, .register-link {
    text-align: center;
    margin-top: 30px;
    font-family: Arial, Verdana, sans-serif;
    font-size: 14px;
    color: #666;
}

.login-link a, .register-link a {
    color: #367AF6;
    text-decoration: none;
}

.login-link a:hover, .register-link a:hover {
    text-decoration: underline;
}

/* Dashboard Specific Styles */
.header {
    background-color: white;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    flex: 1;
    display: flex;
    align-items: center;
}

.connection-indicators {
    display: flex;
    gap: 15px;
}

.connection-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.connection-indicator:hover {
    background-color: #f8f9fa;
}

.indicator-circle {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #ccc; /* Default grey for loading */
    transition: background-color 0.3s ease;
    flex-shrink: 0;
}

.indicator-circle.loading {
    background-color: #ccc;
}

.indicator-circle.connected {
    background-color: #51cf66;
}

.indicator-circle.not-connected {
    background-color: #ff6b6b;
}

.indicator-circle.configured {
    background-color: #ffd43b;
}

.indicator-label {
    font-size: 12px;
    color: #666;
    white-space: nowrap;
}

.content {
    max-width: 800px;
    margin: 0 auto;
    padding: 30px 20px;
}

.welcome-message {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.welcome-message h2 {
    margin: 0 0 10px 0;
    color: #333;
}

.welcome-message p {
    margin: 0;
    color: #666;
    font-size: 16px;
}

.actions, .test-actions {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
}

.actions .button-container, .test-actions .button-container {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-start;
}

.actions h3, .test-actions h3 {
    margin: 0 0 15px 0;
    color: #333;
}

/* Sync controls with minutes input */
.sync-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sync-controls label {
    font-size: 14px;
    color: #555;
    white-space: nowrap;
}

.minutes-input {
    width: 70px;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    text-align: center;
}

.minutes-input:focus {
    outline: none;
    border-color: #4B91F7;
    box-shadow: 0 0 0 2px rgba(75, 145, 247, 0.2);
}

.deal-id-input {
    width: 280px;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.deal-id-input:focus {
    outline: none;
    border-color: #4B91F7;
    box-shadow: 0 0 0 2px rgba(75, 145, 247, 0.2);
}

/* Collapsible header styling */
.collapsible-header {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 15px 0 !important;
    color: #333;
    user-select: none;
    transition: color 0.3s ease;
}

.collapsible-title {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

#unusedCount {
    display: inline-block;
    min-width: 0;
}

.collapsible-header:hover {
    color: #4B91F7;
}

.collapse-indicator {
    font-size: 14px;
    transition: transform 0.3s ease;
    color: #666;
}

/* Collapsible content styling */
.collapsible-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.collapsible-content .button-container {
    padding-top: 0;
}

.label {
    font-weight: bold;
    width: 120px;
    color: #555;
}

.value {
    color: #333;
    word-break: break-all;
}

.exact-config, .teamleader-config {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.exact-config h3, .teamleader-config h3 {
    margin: 0 0 15px 0;
    color: #333;
}

.config-status {
    display: flex;
    margin-bottom: 15px;
    align-items: center;
}

.config-form {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
    background-color: #f8f9fa;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}

.form-group input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: #4B91F7;
    box-shadow: 0 0 0 2px rgba(75, 145, 247, 0.2);
}

.form-group.checkbox-group label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: normal;
}

.form-group.checkbox-group input[type="checkbox"] {
    width: auto;
    margin: 0;
    cursor: pointer;
}

.form-buttons {
    display: flex;
    gap: 10px;
}

.config-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.api-response {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-left: 4px solid #4B91F7;
}

.api-response h4 {
    margin: 0 0 10px 0;
    color: #333;
}

.api-response pre {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    overflow-x: auto;
    font-size: 12px;
    line-height: 1.4;
    color: #333;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.text-black {
    color: black;
}

/* Products Page Specific Styles */
.header-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}

.nav-btn {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s ease;
    margin: 0;
}

.nav-btn:hover {
    background-color: #5a6268;
}

.product-form {
    background: #ffffff;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.product-form h3 {
    margin-top: 0;
    color: #333333;
}

.product-form .form-group {
    margin-bottom: 15px;
}

.product-form .form-group label {
    display: block;
    margin-bottom: 5px;
    color: #333333;
    font-weight: bold;
}

.product-form .form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #ffffff;
    color: #333333;
    font-size: 16px;
    box-sizing: border-box;
}

.product-form .form-group input::placeholder {
    color: #999999;
}

.product-form .form-group small {
    display: block;
    margin-top: 5px;
    color: #666666;
    font-size: 12px;
}

.products-list {
    margin-top: 30px;
}

.products-list h3 {
    color: #333333;
    margin-bottom: 20px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.product-card {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.product-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.product-header h4 {
    margin: 0;
    color: #333333;
    flex: 1;
}

.product-types {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-end;
}

.product-type {
    background: rgba(81, 207, 102, 0.2);
    color: #51cf66;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}

.product-type.unused {
    background: rgba(108, 117, 125, 0.2);
    color: #6c757d;
}

.product-details {
    margin-bottom: 15px;
}

.product-details p {
    margin: 5px 0;
    color: #555555;
    font-size: 14px;
}

.product-actions {
    display: flex;
    gap: 10px;
}

.button-10.small {
    padding: 8px 16px;
    font-size: 12px;
}

.button-10.danger {
    background: #ff6b6b;
    border-color: #ff6b6b;
}

.button-10.danger:hover {
    background: #ff5252;
    border-color: #ff5252;
}

/* Ensure all text in products container is dark */
#productsContainer p {
    color: #333333;
}

#productsContainer {
    color: #333333;
}

/* Excel Upload Section Styles */
.excel-upload-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 30px;
    margin: 30px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.excel-upload-section h3 {
    color: #333333;
    margin-bottom: 10px;
    font-size: 24px;
}

.excel-upload-section p {
    color: #666666;
    margin-bottom: 25px;
    line-height: 1.5;
}

.excel-upload-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.form-group-row .form-group {
    flex: 1;
    min-width: 250px;
}

.excel-upload-form .form-group {
    margin-bottom: 0;
}

.excel-upload-form .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333333;
    font-size: 14px;
}

.excel-upload-form .form-group input[type="text"],
.excel-upload-form .form-group input[type="file"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s ease;
    background: white;
    color: #333333;
    box-sizing: border-box;
}

.excel-upload-form .form-group input[type="file"] {
    padding: 10px 16px;
    cursor: pointer;
}

.excel-upload-form .form-group input:focus {
    outline: none;
    border-color: #51cf66;
    box-shadow: 0 0 0 3px rgba(81, 207, 102, 0.1);
}

.excel-upload-form .form-group input::placeholder {
    color: #999999;
}

.excel-upload-form .form-group small {
    display: block;
    margin-top: 6px;
    color: #666666;
    font-size: 12px;
    line-height: 1.4;
}

.excel-upload-form .form-buttons {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

.excel-upload-form .button-10 {
    min-width: 200px;
    justify-content: center;
}

/* Responsive design for mobile */
@media (max-width: 768px) {
    .form-group-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .form-group-row .form-group {
        min-width: auto;
    }
    
    .excel-upload-form .form-buttons {
        flex-direction: column;
    }
    
    .excel-upload-form .button-10 {
        min-width: auto;
        width: 100%;
    }
}
