/* ===== SHARED STYLES UTILITY ===== */

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

/* === LAYOUT STRUCTURE === */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    background-color: #f5f5f5;
}

.header {
    width: 100%;
    height: 64px;
    background: #ddd;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    font-size: 1.5rem;
    box-sizing: border-box;
}

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

.entity-name {
    font-weight: bold;
    color: #333;
    text-transform: capitalize;
}

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

.user-menu {
    position: relative;
}

.user-menu-btn {
    background: none;
    border: none;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 1rem;
    color: #333;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.user-menu-btn:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    min-width: 160px;
    z-index: 1000;
    display: none;
}

.user-dropdown.show {
    display: block;
}

.dropdown-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.2s;
    border-bottom: 1px solid #f0f0f0;
}

.dropdown-item:last-child {
    border-bottom: none;
}

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

.main {
    display: flex;
    height: calc(100vh - 64px);
}

.sidebar {
    width: 180px;
    background: #e0e0e0;
    padding-top: 40px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.sidebar .menu-item {
    padding: 10px 24px;
    cursor: pointer;
    font-size: 1.1rem;
    color: #222;
    width: 100%;
    box-sizing: border-box;
    border: none;
    background: none;
    text-align: left;
}

.sidebar .menu-item.active {
    background: #fff;
    font-weight: bold;
}

.content {
    flex: 1;
    background: #fafafa;
    padding: 48px;
    min-width: 0;
    overflow-y: auto;
}

/* === TYPOGRAPHY === */
.page-title {
    font-size: 1.8rem;
    margin-bottom: 24px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-title {
    font-size: 1.3rem;
    margin-bottom: 16px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.welcome-message {
    font-size: 1.3rem;
    margin-top: 40px;
    text-align: center;
}

/* === FORM COMPONENTS === */
.form-container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.form-title {
    font-size: 1.5rem;
    margin-bottom: 24px;
    color: #333;
    text-align: center;
}

.form-section {
    margin-bottom: 24px;
}

.form-section h4 {
    margin: 0 0 16px 0;
    color: #333;
    font-size: 1.1rem;
    border-bottom: 2px solid #007bff;
    padding-bottom: 8px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
}

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

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: Arial, sans-serif;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #dee2e6;
}

.help-text {
    font-size: 0.875rem;
    color: #888;
    margin-top: 0.25rem;
}

.radio-group {
    display: flex;
    gap: 16px;
    margin-top: 6px;
}

.radio-item {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.radio-item input[type="radio"] {
    margin: 0;
}

.radio-label {
    font-size: 0.9rem;
    color: #333;
}

/* === BUTTON SYSTEM === */
.action-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: bold;
    text-decoration: none;
    box-sizing: border-box;
}

.action-btn:hover {
    transform: translateY(-1px);
}

.action-btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
}

.action-btn.primary {
    background: #007bff;
    color: white;
}

.action-btn.primary:hover:not(:disabled) {
    background: #0056b3;
}

.action-btn.secondary {
    background: #6c757d;
    color: white;
}

.action-btn.secondary:hover:not(:disabled) {
    background: #545b62;
}

.action-btn.success {
    background: #28a745;
    color: white;
}

.action-btn.success:hover:not(:disabled) {
    background: #1e7e34;
}

.action-btn.danger {
    background: #dc3545;
    color: white;
    border: 1px solid #dc3545;
}

.action-btn.danger:hover:not(:disabled) {
    background: #c82333;
    border-color: #bd2130;
}

.action-btn.small {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.action-btn.large {
    padding: 16px 32px;
    font-size: 1.1rem;
}

.action-buttons {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.submit-btn,
.submit-button {
    width: 100%;
    padding: 12px 24px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    margin-top: 1rem;
    transition: background-color 0.2s;
}

.submit-btn:hover,
.submit-button:hover {
    background-color: #45a049;
}

.submit-btn:disabled,
.submit-button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

/* === LOADING COMPONENTS === */
.loading {
    text-align: center;
    padding: 20px;
    color: #6c757d;
    display: none;
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
    display: none;
}

/* === STATUS/MESSAGE COMPONENTS === */
.status-message {
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 4px;
    display: none;
}

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

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

.status-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.error-message {
    color: #dc3545;
    margin-top: 16px;
    padding: 12px;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    display: none;
}

/* === TOAST NOTIFICATION SYSTEM === */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 16px 20px;
    min-width: 300px;
    max-width: 500px;
    z-index: 1000;
    transform: translateX(400px);
    transition: transform 0.3s ease-in-out;
    display: flex;
    align-items: center;
    gap: 12px;
    border-left: 4px solid;
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    border-left-color: #28a745;
    background: #f8fff9;
}

.toast.error {
    border-left-color: #dc3545;
    background: #fff8f8;
}

.toast-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 4px;
    color: #333;
}

.toast-message {
    font-size: 13px;
    color: #666;
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-close:hover {
    color: #666;
}

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

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

.modal-content.large {
    max-width: 800px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #dee2e6;
    background: #f8f9fa;
    border-radius: 12px 12px 0 0;
}

.modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 1.2rem;
    flex: 1;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: #333;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 50%;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid #dee2e6;
    background: #f8f9fa;
    border-radius: 0 0 12px 12px;
}

/* === CARD COMPONENTS === */
.card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 24px;
    border: 1px solid #e9ecef;
    margin-bottom: 24px;
}

.card.white {
    background: white;
    border: 1px solid #dee2e6;
}

/* === TABLE COMPONENTS === */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.data-table th {
    background: #f8f9fa;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 1px solid #dee2e6;
    font-size: 0.9rem;
}

.data-table td {
    padding: 12px;
    border-bottom: 1px solid #f8f9fa;
    font-size: 0.9rem;
}

.data-table tbody tr:hover {
    background: #f8f9fa;
}

.data-table.striped tbody tr:nth-child(even) {
    background: #f8f9fa;
}

/* === BADGE SYSTEM === */
.badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    display: inline-block;
}

.badge.regular {
    background: #d1f2eb;
    color: #00695c;
}

.badge.ai-room {
    background: #f8d7da;
    color: #721c24;
}

.badge.success {
    background: #d4edda;
    color: #155724;
}

.badge.warning {
    background: #fff3cd;
    color: #856404;
}

.badge.danger {
    background: #f8d7da;
    color: #721c24;
}

/* === PROGRESS COMPONENTS === */
.progress-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #007bff, #28a745);
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s ease;
}

.progress-bar-mini {
    width: 80px;
    height: 4px;
    background: #e9ecef;
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill-mini {
    height: 100%;
    background: #28a745;
    transition: width 0.3s;
}

/* === UTILITY CLASSES === */
.no-data,
.no-schedule {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 40px;
}

.no-data-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 8px;
}

.warning-text {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #856404;
    background: #fff3cd;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #ffeaa7;
    font-size: 0.9rem;
}

.instruction-text {
    margin: 0 0 16px 0;
    color: #6c757d;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* === AI QA & CONTENT DISPLAY === */
.answer-container {
    margin-top: 32px;
    display: none;
}

.answer-title {
    font-size: 1.2rem;
    margin-bottom: 16px;
    color: #333;
    font-weight: bold;
}

.answer-content {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.answer-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
}

.image-download-btn {
    margin-top: 12px;
    padding: 8px 16px;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.image-download-btn:hover {
    background-color: #218838;
}

.resolution-group {
    display: none;
}

.resolution-group.show {
    display: block;
}


/* === RESPONSIVE DESIGN === */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .content {
        padding: 24px;
    }
    
    .modal-content {
        margin: 20px;
        width: calc(100% - 40px);
    }
    
    .action-buttons {
        flex-direction: column;
    }
}

/* === NAVIGATION SPECIFIC === */
.sub-nav {
    background: white;
    border-radius: 8px;
    padding: 8px;
    margin-bottom: 24px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    gap: 8px;
}

.sub-nav-item {
    padding: 8px 16px;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
    transition: background-color 0.2s;
}

.sub-nav-item.active {
    background: #007bff;
    color: white;
}

.sub-nav-item:hover:not(.active) {
    background: #f8f9fa;
}