/* Essential styles for LightScribe App */

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

/* Modal Overlay/Backdrop */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

/* Show modal when active */
.modal.active,
.modal.show,
.modal[style*="display: block"] {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

/* Modal Dialog Wrapper */
.modal-dialog {
    position: relative;
    width: auto;
    max-width: 500px;
    margin: 1.75rem auto;
    pointer-events: none;
}

/* Modal Content Box */
.modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    pointer-events: auto;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 0.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    outline: 0;
    padding: 0;
    margin: 0 auto;
}

/* Modal Header */
.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #dee2e6;
    border-top-left-radius: 0.5rem;
    border-top-right-radius: 0.5rem;
}

.modal-title {
    margin: 0;
    line-height: 1.5;
    font-size: 1.25rem;
    font-weight: 500;
    color: #212529;
}

.modal-header .close {
    padding: 1rem;
    margin: -1rem -1rem -1rem auto;
    background: transparent;
    border: 0;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    color: #000;
    text-shadow: 0 1px 0 #fff;
    opacity: 0.5;
    cursor: pointer;
}

.modal-header .close:hover {
    opacity: 0.75;
}

/* Modal Body */
.modal-body {
    position: relative;
    flex: 1 1 auto;
    padding: 1.5rem;
    color: #212529;
}

/* Modal Footer */
.modal-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    padding: 0.75rem 1.5rem;
    border-top: 1px solid #dee2e6;
    border-bottom-right-radius: 0.5rem;
    border-bottom-left-radius: 0.5rem;
    gap: 0.5rem;
}

.modal-footer > * {
    margin: 0.25rem;
}

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

.btn {
    display: inline-block;
    font-weight: 400;
    line-height: 1.5;
    color: #212529;
    text-align: center;
    text-decoration: none;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    background-color: transparent;
    border: 1px solid transparent;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    border-radius: 0.25rem;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, 
                border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.btn:hover {
    color: #212529;
}

.btn:focus {
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.btn:disabled,
.btn.disabled {
    opacity: 0.65;
    cursor: not-allowed;
    pointer-events: none;
}

/* Primary Button */
.btn-primary {
    color: #fff;
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.btn-primary:hover {
    color: #fff;
    background-color: #0b5ed7;
    border-color: #0a58ca;
}

.btn-primary:focus {
    color: #fff;
    background-color: #0b5ed7;
    border-color: #0a58ca;
    box-shadow: 0 0 0 0.25rem rgba(49, 132, 253, 0.5);
}

.btn-primary:active {
    color: #fff;
    background-color: #0a58ca;
    border-color: #0a53be;
}

.btn-primary:active:focus {
    box-shadow: 0 0 0 0.25rem rgba(49, 132, 253, 0.5);
}

/* Secondary Button */
.btn-secondary {
    color: #fff;
    background-color: #6c757d;
    border-color: #6c757d;
}

.btn-secondary:hover {
    color: #fff;
    background-color: #5c636a;
    border-color: #565e64;
}

.btn-secondary:focus {
    color: #fff;
    background-color: #5c636a;
    border-color: #565e64;
    box-shadow: 0 0 0 0.25rem rgba(130, 138, 145, 0.5);
}

.btn-secondary:active {
    color: #fff;
    background-color: #565e64;
    border-color: #51585e;
}

.btn-secondary:active:focus {
    box-shadow: 0 0 0 0.25rem rgba(130, 138, 145, 0.5);
}

/* ============================================
   Z-INDEX HIERARCHY
   ============================================ */

/* Ensure modals appear above other content */
.modal {
    z-index: 1050;
}

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1040;
    width: 100vw;
    height: 100vh;
    background-color: #000;
}

/* Processing modal (higher z-index if needed) */
#processing-note-modal {
    z-index: 1100;
}

/* ============================================
   SIDEBAR STYLES
   ============================================ */

/* Base sidebar container */
.sidebar {
    --sidebar-width: 280px;
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background-color: #ffffff !important;
    border-right: 1px solid #e5e7eb;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out, background-color 0s;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.sidebar.active {
    transform: translateX(0);
    background-color: #ffffff !important;
}

/* Sidebar content wrapper */
.sidebar-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
    padding: 1rem;
}

.sidebar-content::-webkit-scrollbar {
    width: 6px;
}

.sidebar-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.sidebar-content::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.sidebar-content::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Sidebar header */
.header-container {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.header-container h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 0.5rem 0;
}

.subtitle {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

/* User account menu */
.user-account-menu {
    margin-bottom: 1rem;
}

.account-dropdown {
    display: none;
}

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

.user-info {
    padding: 0.75rem;
    background: #f9fafb;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: #374151;
}

.account-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    color: #374151;
    text-decoration: none;
    border-radius: 0.375rem;
    transition: background-color 0.15s ease-in-out;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.account-item:hover {
    background-color: #f3f4f6;
}

.account-item i {
    margin-right: 0.75rem;
    width: 16px;
    text-align: center;
}

/* Cache action buttons */
.cache-action-buttons {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.cache-action-btn {
    width: 100%;
    padding: 0.75rem;
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.cache-action-btn:hover {
    background-color: #fecaca;
    border-color: #fca5a5;
}

.cache-action-btn i {
    font-size: 0.875rem;
}

/* Cached notes container */
#cached-notes {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

/* Empty state */
#cached-notes .text-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    text-align: center;
    color: #6b7280;
}

#cached-notes .text-center i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: #9ca3af;
}

#cached-notes .text-center p {
    margin: 0.25rem 0;
    font-size: 0.875rem;
}

/* Note card styling */
#cached-notes > div {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
}

#cached-notes > div:hover {
    border-color: #d1d5db;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

#cached-notes > div.bg-white {
    background: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Note preview text */
.note-preview {
    font-size: 0.875rem;
    font-weight: 500;
    color: #111827;
    margin-bottom: 0.5rem;
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.note-full-content {
    font-size: 0.75rem;
    color: #374151;
    line-height: 1.6;
    white-space: pre-line;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.note-full-content.hidden {
    display: none;
}

/* Copy button in note cards */
#cached-notes .copy-btn {
    font-size: 0.75rem;
    color: #2563eb;
    border: 1px solid #bfdbfe;
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
    background: transparent;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

#cached-notes .copy-btn:hover {
    background-color: #eff6ff;
    border-color: #93c5fd;
}

#cached-notes .copy-btn i {
    font-size: 0.75rem;
}

/* Spinning animation for refresh button */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.spinning {
    animation: spin 1s linear infinite;
}

/* ============================================
   NOTE RESULT STYLES
   ============================================ */

/* Note result container - no border, relies on outer container shadow */
.note-result {
    border: none !important;
}

/* Note content container - no border, uses background color for separation */
.note-content {
    border: none !important;
}

/* ============================================
   FLOATING BUTTONS STYLES
   ============================================ */

/* Floating buttons container - transition for smooth movement */
.floating-buttons {
    transition: left 0.3s ease-in-out, width 0.3s ease-in-out;
}

/* Shift floating buttons right when sidebar is active */
.floating-buttons.sidebar-active {
    left: var(--sidebar-width, 280px) !important;
    width: calc(100vw - var(--sidebar-width, 280px)) !important;
}

