/* Global Styles
 * Centralized styling for body, common elements, forms, tables, and buttons across all sections
 * Edit this file to modify global styles at once
 */

/* ==========================================
   CSS VARIABLES
   ========================================== */

:root {
    /* Table colors - can be customized via Settings > Tables */
    --table-hover-bg-color: #e3f2fd;
    --table-even-bg-color: #f8f9ff;
}

/* ==========================================
   BODY STYLES
   ========================================== */

body {
    font-family: 'Inter', sans-serif;
    color: #333;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    line-height: 1.6;
}

/* ==========================================
   COMMON RESET & BASE STYLES
   ========================================== */

* {
    box-sizing: border-box;
}

/* Remove default margins and padding from common elements */
h1, h2, h3, h4, h5, h6, p, ul, ol, li {
    margin: 0;
    padding: 0;
}

/* ==========================================
   UTILITY CLASSES
   ========================================== */

.text-left {
    text-align: left;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

/* ==========================================
   SECTION SPECIFIC STYLES
   ========================================== */

/* Conversations Section */
#conversations-section {
    padding-top: 100px;
}

/* ==========================================
   TABLE CONTAINER STYLES
   ========================================== */

/* Apply to all admin section table containers */
.table-container,
#users-section .table-container,
#roles-section .table-container,
#permissions-section .table-container,
#clients-section .table-container,
#receipts-section .table-container,
#projects-section .table-container,
#processing-section .table-container,
#llm-section .table-container,
#data-section .table-container,
#tasks-section #tasks-list-container {
    margin-bottom: 20px !important;
    background: transparent;
    box-shadow: none;
    border: 0.5px solid #c1c1c1;
    overflow-x: auto;
}

/* Figma comments container in tasks section */
.figma-comments-table-container {
    margin-bottom: 20px !important;
    background: transparent;
    box-shadow: none;
    border: 0.5px solid #c1c1c1;
    overflow-x: auto;
}

/* ==========================================
   TABLE HEADER STYLES
   ========================================== */

/* Unified cell padding for all tables */
#tasks-table th,
#tasks-table td,
#projects-table th,
#projects-table td,
#processors-table th,
#processors-table td,
#llms-table th,
#llms-table td,
#data-providers-table th,
#data-providers-table td,
#users-table th,
#users-table td,
#roles-table th,
#roles-table td,
#permissions-table th,
#permissions-table td,
#clients-table th,
#clients-table td,
#receipts-table th,
#receipts-table td {
    padding: 16px;
}

/* Unified header styling for all tables */
#tasks-table th,
#projects-table th,
#processors-table th,
#llms-table th,
#data-providers-table th,
#users-table th,
#roles-table th,
#permissions-table th,
#clients-table th,
#receipts-table th,
#figma-comments-table th {
    background: none!important;
    color: #495057;
    font-weight: lighter;
    font-size: 7px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    height: 20px;
    padding: 5px;
    z-index: 10;
    border: none;
}

/* ==========================================
   TABLE ROW STYLES
   ========================================== */

/* Alternating row colors for all tables */
#tasks-table tbody tr:nth-child(odd),
#projects-table tbody tr:nth-child(odd),
#processors-table tbody tr:nth-child(odd),
#llms-table tbody tr:nth-child(odd),
#data-providers-table tbody tr:nth-child(odd),
#users-table tbody tr:nth-child(odd),
#roles-table tbody tr:nth-child(odd),
#permissions-table tbody tr:nth-child(odd),
#clients-table tbody tr:nth-child(odd),
#receipts-table tbody tr:nth-child(odd),
#figma-comments-table tbody tr:nth-child(odd) {
    background-color: #fafafa;
}

#tasks-table tbody tr:nth-child(even),
#projects-table tbody tr:nth-child(even),
#processors-table tbody tr:nth-child(even),
#llms-table tbody tr:nth-child(even),
#data-providers-table tbody tr:nth-child(even),
#users-table tbody tr:nth-child(even),
#roles-table tbody tr:nth-child(even),
#permissions-table tbody tr:nth-child(even),
#clients-table tbody tr:nth-child(even),
#receipts-table tbody tr:nth-child(even),
#figma-comments-table tbody tr:nth-child(even) {
    background-color: var(--table-even-bg-color);
}

/* Hover effects for all tables */
#tasks-table tbody tr:hover,
#projects-table tbody tr:hover,
#processors-table tbody tr:hover,
#llms-table tbody tr:hover,
#data-providers-table tbody tr:hover,
#users-table tbody tr:hover,
#roles-table tbody tr:hover,
#permissions-table tbody tr:hover,
#clients-table tbody tr:hover,
#receipts-table tbody tr:hover,
#figma-comments-table tbody tr:hover {
    background-color: var(--table-hover-bg-color) !important;
}

/* ==========================================
   HEADER BUTTON STYLES
   ========================================== */

/* Unified "Add" button styling in global header */
.section-buttons .add-task-button,
.section-buttons .add-project-button,
.section-buttons .add-processor-button,
.section-buttons .add-llm-button,
.section-buttons .add-data-provider-button,
.section-buttons .add-user-button,
.section-buttons .add-client-button,
.section-buttons .add-receipt-button,
.section-buttons .add-role-button {
    background: transparent;
    color: #6c757d;
    border: 0.5px solid #c1c1c1;
    padding: 4px;
    padding-right: 6px;
    border-radius: 6px;
    font-size: 10px;
    text-transform: uppercase;
    font-weight: lighter;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
    box-shadow: none;
}

.section-buttons .add-task-button:hover,
.section-buttons .add-project-button:hover,
.section-buttons .add-processor-button:hover,
.section-buttons .add-llm-button:hover,
.section-buttons .add-data-provider-button:hover,
.section-buttons .add-user-button:hover,
.section-buttons .add-client-button:hover,
.section-buttons .add-receipt-button:hover,
.section-buttons .add-role-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.section-buttons .add-task-button i,
.section-buttons .add-project-button i,
.section-buttons .add-processor-button i,
.section-buttons .add-llm-button i,
.section-buttons .add-data-provider-button i,
.section-buttons .add-user-button i,
.section-buttons .add-client-button i,
.section-buttons .add-receipt-button i,
.section-buttons .add-role-button i {
    font-size: 16px;
}

/* ==========================================
   FORM LABEL STYLES (inspired by table headers)
   ========================================== */

/* Unified form label styling across all sections and modals 
   Includes: profile, login, password-recovery, signup, conversations, images, videos, settings, workshop, and modals */
#profile-section .form-group label,
#login-section .form-group label,
#password-recovery-section .form-group label,
#signup-section .form-group label,
#conversations-section .form-group label,
#images-section .form-group label,
#videos-section .form-group label,
#settings-section .form-group label,
#workshop-section .form-group label,
#booking-section .form-group label,
.modal .form-group label {
    display: block;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: lighter;
    color: #495057;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

/* ==========================================
   FORM INPUT STYLES
   ========================================== */

/* Unified input styling */
#profile-section .form-group input,
#profile-section .form-group textarea,
#profile-section .form-group select,
#login-section .form-group input,
#login-section .form-group textarea,
#login-section .form-group select,
#password-recovery-section .form-group input,
#password-recovery-section .form-group textarea,
#password-recovery-section .form-group select,
#signup-section .form-group input,
#signup-section .form-group textarea,
#signup-section .form-group select,
#conversations-section .form-group input,
#conversations-section .form-group textarea,
#conversations-section .form-group select,
#images-section .form-group input,
#images-section .form-group textarea,
#images-section .form-group select,
#videos-section .form-group input,
#videos-section .form-group textarea,
#videos-section .form-group select,
#settings-section .form-group input,
#settings-section .form-group textarea,
#settings-section .form-group select,
#workshop-section .form-group input,
#workshop-section .form-group textarea,
#workshop-section .form-group select,
#booking-section .form-group input,
#booking-section .form-group textarea,
#booking-section .form-group select,
.booking-form .form-group input,
.booking-form .form-group textarea,
.booking-form .form-group select,
.modal .form-group input,
.modal .form-group textarea,
.modal .form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 0.5px solid #c1c1c1;
    border-radius: 6px;
    font-size: 16px;
    font-family: 'Inter', sans-serif;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
    background: transparent;
    color: #495057;
    height: 44px; /* Fixed height matching buttons */
}

/* Exclude checkboxes and radio buttons from fixed height */
#profile-section .form-group input[type="checkbox"],
#profile-section .form-group input[type="radio"],
#login-section .form-group input[type="checkbox"],
#login-section .form-group input[type="radio"],
#password-recovery-section .form-group input[type="checkbox"],
#password-recovery-section .form-group input[type="radio"],
#signup-section .form-group input[type="checkbox"],
#signup-section .form-group input[type="radio"],
#conversations-section .form-group input[type="checkbox"],
#conversations-section .form-group input[type="radio"],
#images-section .form-group input[type="checkbox"],
#images-section .form-group input[type="radio"],
#videos-section .form-group input[type="checkbox"],
#videos-section .form-group input[type="radio"],
#settings-section .form-group input[type="checkbox"],
#settings-section .form-group input[type="radio"],
#workshop-section .form-group input[type="checkbox"],
#workshop-section .form-group input[type="radio"],
#booking-section .form-group input[type="checkbox"],
#booking-section .form-group input[type="radio"],
.booking-form .form-group input[type="checkbox"],
.booking-form .form-group input[type="radio"],
.modal .form-group input[type="checkbox"],
.modal .form-group input[type="radio"] {
    height: auto;
    width: auto;
}

/* Textarea specific height */
#profile-section .form-group textarea,
#login-section .form-group textarea,
#password-recovery-section .form-group textarea,
#signup-section .form-group textarea,
#conversations-section .form-group textarea,
#images-section .form-group textarea,
#videos-section .form-group textarea,
#settings-section .form-group textarea,
#workshop-section .form-group textarea,
#booking-section .form-group textarea,
.booking-form .form-group textarea,
.modal .form-group textarea {
    height: auto;
    min-height: 88px; /* Double the input height */
}

/* Add consistent spacing between form groups in all sections and modals */
#profile-section .form-group,
#login-section .form-group,
#password-recovery-section .form-group,
#signup-section .form-group,
#conversations-section .form-group,
#images-section .form-group,
#videos-section .form-group,
#settings-section .form-group,
#workshop-section .form-group,
#booking-section .form-group,
.modal .form-group {
    margin-bottom: 24px;
}

/* Input focus state */
#profile-section .form-group input:focus,
#profile-section .form-group textarea:focus,
#profile-section .form-group select:focus,
#login-section .form-group input:focus,
#login-section .form-group textarea:focus,
#login-section .form-group select:focus,
#password-recovery-section .form-group input:focus,
#password-recovery-section .form-group textarea:focus,
#password-recovery-section .form-group select:focus,
#signup-section .form-group input:focus,
#signup-section .form-group textarea:focus,
#signup-section .form-group select:focus,
#conversations-section .form-group input:focus,
#conversations-section .form-group textarea:focus,
#conversations-section .form-group select:focus,
#images-section .form-group input:focus,
#images-section .form-group textarea:focus,
#images-section .form-group select:focus,
#videos-section .form-group input:focus,
#videos-section .form-group textarea:focus,
#videos-section .form-group select:focus,
#settings-section .form-group input:focus,
#settings-section .form-group textarea:focus,
#settings-section .form-group select:focus,
#workshop-section .form-group input:focus,
#workshop-section .form-group textarea:focus,
#workshop-section .form-group select:focus,
#booking-section .form-group input:focus,
#booking-section .form-group textarea:focus,
#booking-section .form-group select:focus,
.booking-form .form-group input:focus,
.booking-form .form-group textarea:focus,
.booking-form .form-group select:focus,
.modal .form-group input:focus,
.modal .form-group textarea:focus,
.modal .form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* ==========================================
   BUTTON STYLES
   ========================================== */

/* Unified submit button - matching input height and global header style */
#profile-section .submit-btn,
#profile-section .profile-button,
#login-section .submit-btn,
#login-section .login-button,
#password-recovery-section .submit-btn,
#password-recovery-section .password-recovery-button,
#signup-section .submit-btn,
#signup-section .signup-button,
#conversations-section .submit-btn,
#images-section .submit-btn,
#videos-section .submit-btn,
#settings-section .submit-btn,
.modal .submit-btn {
    background: transparent;
    color: #6c757d;
    border: 0.5px solid #c1c1c1;
    padding: 0 16px;
    border-radius: 6px;
    font-size: 10px;
    text-transform: uppercase;
    font-weight: lighter;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
    box-shadow: none;
    height: 44px; /* Same height as inputs */
    font-family: 'Inter', sans-serif;
    margin-bottom: 20px; /* Consistent spacing below all submit buttons */
}

#profile-section .submit-btn:hover,
#profile-section .profile-button:hover,
#login-section .submit-btn:hover,
#login-section .login-button:hover,
#password-recovery-section .submit-btn:hover,
#password-recovery-section .password-recovery-button:hover,
#signup-section .submit-btn:hover,
#signup-section .signup-button:hover,
#conversations-section .submit-btn:hover,
#images-section .submit-btn:hover,
#videos-section .submit-btn:hover,
#settings-section .submit-btn:hover,
.modal .submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

#profile-section .submit-btn:disabled,
#profile-section .profile-button:disabled,
#login-section .submit-btn:disabled,
#login-section .login-button:disabled,
#password-recovery-section .submit-btn:disabled,
#password-recovery-section .password-recovery-button:disabled,
#signup-section .submit-btn:disabled,
#signup-section .signup-button:disabled,
#conversations-section .submit-btn:disabled,
#images-section .submit-btn:disabled,
#videos-section .submit-btn:disabled,
#settings-section .submit-btn:disabled,
.modal .submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

#profile-section .submit-btn i,
#profile-section .profile-button i,
#conversations-section .submit-btn i,
#images-section .submit-btn i,
#videos-section .submit-btn i,
#settings-section .submit-btn i {
    font-size: 16px;
}

/* Unified cancel button */
#profile-section .cancel-btn,
#conversations-section .cancel-btn,
#images-section .cancel-btn,
#videos-section .cancel-btn,
#settings-section .cancel-btn,
.modal .cancel-btn {
    background: transparent;
    color: #6c757d;
    border: 0.5px solid #c1c1c1;
    padding: 0 16px;
    border-radius: 6px;
    font-size: 10px;
    text-transform: uppercase;
    font-weight: lighter;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
    box-shadow: none;
    height: 44px; /* Same height as inputs */
    font-family: 'Inter', sans-serif;
    margin-bottom: 20px; /* Consistent spacing below all cancel buttons */
}

#profile-section .cancel-btn:hover,
#conversations-section .cancel-btn:hover,
#images-section .cancel-btn:hover,
#videos-section .cancel-btn:hover,
#settings-section .cancel-btn:hover,
.modal .cancel-btn:hover {
    background-color: #5a6268;
    color: white;
    transform: translateY(-1px);
}

/* Danger button class for destructive actions like logout */
.danger-btn {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
}

.danger-btn:hover {
    background: #c82333;
    border-color: #c82333;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

/* ==========================================
   MODAL STYLES
   ========================================== */

/* Modal overlay */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.modal.open,
.modal[style*="display: block"] {
    animation: fadeIn 0.3s ease-out;
}

/* Modal content container */
.modal-content {
    background-color: #fff;
    margin: 90px auto 90px auto;
    padding: 0;
    border-radius: 12px;
    width: 70%;
    max-width: 70%;
    max-height: calc(100vh - 180px); /* Account for 90px top and bottom margins */
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    scroll-behavior: smooth;
}

/* Custom animation duration for modals - faster and longer slide */
.modal-content.animate__animated {
    --animate-duration: 0.5s;
}

.modal-content.animate__slideInUp {
    animation-name: slideInUpBig;
}

.modal-content.animate__slideOutDown {
    animation-name: slideOutDownBig;
    --animate-duration: 0.25s; /* Much faster closing */
}

@keyframes slideInUpBig {
    from {
        transform: translate3d(0, 100%, 0);
        opacity: 0;
    }
    to {
        transform: translate3d(0, 0, 0);
        opacity: 1;
    }
}

@keyframes slideOutDownBig {
    from {
        transform: translate3d(0, 0, 0);
        opacity: 1;
    }
    to {
        transform: translate3d(0, 100%, 0);
        opacity: 0;
    }
}

/* Smooth scrollbar for modal content */
.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 0 12px 12px 0;
}

.modal-content::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Modal header */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 24px 0 24px;
    margin-bottom: 20px;
}

.modal-header h2 {
    margin: 0;
    color: #333;
    font-size: 24px;
    font-weight: 700;
    font-family: 'Inter Tight', sans-serif;
}

/* Close button */
.close-modal {
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    transition: color 0.2s ease;
}

.close-modal:hover {
    color: #333;
}

/* Modal animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Form actions in modals */
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

/* Responsive modal styles */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 20px auto 20px auto;
        max-height: calc(100vh - 40px); /* Account for 20px top and bottom margins on mobile */
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .cancel-btn,
    .form-actions .submit-btn {
        width: 100%;
    }
}

/* ==========================================
   SPECIAL BUTTON EFFECTS
   ========================================== */

/* Animated rainbow glow effect on hover */
.glow-on-hover-white {
    border: none;
    outline: none;
    cursor: pointer;
    position: relative;
    z-index: 0;
    border-radius: 10px;
}

.glow-on-hover-white:hover:before {
    opacity: 1;
    filter: blur(10px);
    transition: filter .3s ease-in-out;
}

.glow-on-hover-white:before {
    content: '';
    background: linear-gradient(45deg, #ff0000, #ff7300, #fffb00, #48ff00, #00ffd5, #002bff, #7a00ff, #ff00c8, #ff0000);
    position: absolute;
    top: -2px;
    left: -2px;
    background-size: 400%;
    z-index: -1;
    filter: blur(0px);
    width: calc(100% + 4px);
    height: calc(100% + 4px);
    animation: glowing 20s linear infinite;
    opacity: 1;
    transition: opacity .3s ease-in-out;
    transition: filter .3s ease-in-out;
    border-radius: 10px;
}

.glow-on-hover-white:active:after {
    background: transparent;
}

.glow-on-hover-white:after {
    z-index: -1;
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: #FAFAFA;
    left: 0;
    top: 0;
    border-radius: 10px;
}

@keyframes glowing {
    0% { background-position: 0 0; }
    50% { background-position: 400% 0; }
    100% { background-position: 0 0; }
}

/* Animated rainbow glow effect with black background */
#glow-on-hover-black {
    border: none;
    outline: none;
    cursor: pointer;
    position: relative;
    z-index: 0;
    border-radius: 10px;
}

#glow-on-hover-black:hover:before {
    opacity: 1;
    filter: blur(10px);
    transition: filter .3s ease-in-out;
}

#glow-on-hover-black:before {
    content: '';
    background: linear-gradient(45deg, #ff0000, #ff7300, #fffb00, #48ff00, #00ffd5, #002bff, #7a00ff, #ff00c8, #ff0000);
    position: absolute;
    top: -1px;
    left: -1px;
    background-size: 400%;
    z-index: -1;
    filter: blur(0px);
    width: calc(100% + 2px);
    height: calc(100% + 2px);
    animation: glowing 10s linear infinite;
    opacity: 1;
    transition: opacity .3s ease-in-out;
    transition: filter .3s ease-in-out;
    border-radius: 10px;
}

#glow-on-hover-black:active:after {
    background: transparent;
}

#glow-on-hover-black:after {
    z-index: -1;
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: #111;
    left: 0;
    top: 0;
    border-radius: 10px;
}
