* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Settings Dropdown Menu */
.settings-menu-button {
    position: relative;
    transition: all 0.3s ease;
}

.settings-menu-button:hover {
    background: #f0f0f0 !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.dropdown-arrow {
    font-size: 0.7rem;
    transition: transform 0.3s ease;
}

.settings-menu-button.active .dropdown-arrow {
    transform: rotate(180deg);
}

.settings-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    min-width: 220px;
    z-index: 1000;
    overflow: hidden;
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.settings-dropdown.hidden {
    display: none;
}

.dropdown-item {
    width: 100%;
    padding: 12px 20px;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
    color: #333;
    transition: all 0.2s ease;
    font-family: inherit;
}

.dropdown-item:hover {
    background: #f8f9fa;
    color: #133852;
}

.dropdown-item:active {
    background: #e9ecef;
}

.dropdown-item span:first-child {
    font-size: 1.1rem;
    width: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dropdown-item.logout-item {
    color: #dc2626;
}

.dropdown-item.logout-item:hover {
    background: #fee2e2;
    color: #b91c1c;
}

.dropdown-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 4px 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #133852 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
    padding: 30px 0;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

.chat-link {
    background: white;
    color: #133852;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.chat-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.dashboard-layout {
    display: flex;
    gap: 30px;
    margin-bottom: 40px;
    min-height: 600px;
}

/* Sidebar Menu */
.sidebar-menu {
    width: 250px;
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: fit-content;
    position: sticky;
    top: 20px;
}

.menu-item {
    padding: 15px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8f9fa;
    border: 2px solid transparent;
}

.menu-item:hover {
    background: rgba(102, 126, 234, 0.1);
    transform: translateX(5px);
}

.menu-item.active {
    background: linear-gradient(135deg, #133852 0%, #764ba2 100%);
    color: white;
    border-color: #133852;
}

.menu-item h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    color: inherit;
}

/* Main Content Area */
.main-content {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.card {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
    width: 100%;
    height: fit-content;
    min-height: auto;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.15);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    padding-bottom: 20px;
    margin: 0 -10px 25px -10px;
    border-bottom: 2px solid #f0f0f0;
    cursor: default;
    user-select: none;
    transition: background-color 0.2s ease, margin-bottom 0.3s ease;
    border-radius: 8px;
}

.card-collapsed .card-header {
    margin-bottom: 0;
    padding-bottom: 10px;
    border-bottom: none;
}

.action-button-container {
    display: flex;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.card-header:hover {
    background-color: transparent;
}

.card-header h2 {
    font-size: 1.5rem;
    color: #133852;
    font-weight: 700;
}

.btn-primary {
    background: linear-gradient(135deg, #133852 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: #e0e0e0;
    color: #333;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: #d0d0d0;
}

.card-content {
    color: #555;
    max-height: 5000px;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease 0.1s, height 0.4s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.3s ease 0.1s;
    opacity: 1;
    display: block;
    width: 100%;
    visibility: visible;
}

.card-content.collapsed {
    max-height: 0 !important;
    height: 0 !important;
    opacity: 0;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden;
    visibility: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease, padding 0.3s ease, margin 0.3s ease, height 0.4s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.2s ease;
}

.card-content {
    display: block !important;
}

.collapse-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
    color: #133852;
    font-size: 1.2rem;
    width: 32px;
    height: 32px;
}

.collapse-btn:hover {
    background-color: rgba(102, 126, 234, 0.1);
}

.collapse-icon {
    transition: transform 0.3s ease;
    display: inline-block;
    font-size: 0.9rem;
}

.collapse-icon.collapsed {
    transform: rotate(0deg);
}

.date-selector-container {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.date-selector-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.date-selector-group label {
    font-weight: 600;
    color: #133852;
    font-size: 0.95rem;
}

.date-select {
    padding: 10px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    background: white;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
}

.date-select:hover {
    border-color: #133852;
}

.date-select:focus {
    outline: none;
    border-color: #133852;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.results-container {
    min-height: 200px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 2px dashed #e0e0e0;
}

.results-container .placeholder {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 40px 20px;
}

.ai-input-container,
.action-input-container {
    margin-bottom: 25px;
}

.ai-input-container label,
.action-input-container label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #133852;
    font-size: 0.95rem;
}

.ai-input-textarea,
.action-input-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    background: white;
    color: #333;
    resize: vertical;
    transition: all 0.3s ease;
}

.ai-input-textarea:hover,
.action-input-textarea:hover {
    border-color: #133852;
}

.ai-input-textarea:focus,
.action-input-textarea:focus {
    outline: none;
    border-color: #133852;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.ai-input-textarea::placeholder,
.action-input-textarea::placeholder {
    color: #999;
}

.chart-container {
    margin-top: 20px;
    margin-bottom: 20px;
    position: relative;
    height: 300px;
    width: 100%;
    min-height: 300px;
    background: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.chart-container h3 {
    margin-bottom: 15px;
    color: #133852;
    font-size: 1.2rem;
    font-weight: 600;
}

.chart-container canvas {
    display: block !important;
    width: 100% !important;
    height: 250px !important;
    max-width: 100% !important;
    max-height: 250px !important;
}

.success-message {
    background: #d4edda;
    color: #155724;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    border: 1px solid #c3e6cb;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    border: 1px solid #f5c6cb;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    color: white;
}

.loading-overlay.hidden {
    display: none;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.hidden {
    display: none !important;
}

/* NetSuite Authentication Form Styles */
.netsuite-auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 25px;
}

.netsuite-auth-form.hidden {
    display: none;
}

.auth-input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.auth-input-group label {
    font-weight: 600;
    color: #133852;
    font-size: 0.95rem;
}

.auth-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    background: white;
    color: #333;
    transition: all 0.3s ease;
}

.auth-input:hover {
    border-color: #133852;
}

.auth-input:focus {
    outline: none;
    border-color: #133852;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.auth-input::placeholder {
    color: #999;
}

.auth-button {
    align-self: flex-start;
    margin-top: 10px;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 2px solid #f0f0f0;
}

.modal-header h2 {
    font-size: 1.5rem;
    color: #133852;
    font-weight: 700;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

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

.modal-body {
    padding: 30px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    padding: 20px 30px;
    border-top: 2px solid #f0f0f0;
}

.settings-message {
    padding: 12px;
    border-radius: 8px;
    margin-top: 15px;
    font-size: 0.95rem;
}

.settings-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.settings-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.settings-message.hidden {
    display: none;
}
