/* Quick Access Modal - Global Utility Modal */

/* Floating Action Button */
.quick-access-fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    z-index: 9998;
    transition: transform 0.2s, box-shadow 0.2s;
    color: white;
    font-size: 24px;
    user-select: none;
}

.quick-access-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.5);
}

.quick-access-fab:active {
    transform: scale(0.95);
}

/* Modal Overlay */
.quick-access-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: qaFadeIn 0.2s ease-out;
}

.quick-access-overlay.active {
    display: flex;
}

@keyframes qaFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Modal Content */
.quick-access-modal {
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    max-width: 900px;
    width: 90vw;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    animation: qaSlideIn 0.3s ease-out;
    position: relative;
}

@keyframes qaSlideIn {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Modal Header */
.qa-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 2px solid #e0e0e0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px 12px 0 0;
    cursor: move;
    user-select: none;
}

.qa-header:active {
    cursor: grabbing;
}

.qa-header h2 {
    margin: 0;
    color: white;
    font-size: 1.4rem;
}

.qa-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    font-size: 1.8rem;
    color: white;
    cursor: pointer;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: background 0.2s;
}

.qa-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Horizontal Icon Menu */
.qa-menu {
    display: flex;
    gap: 0;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    overflow-x: auto;
    min-height: 80px;
    flex-shrink: 0;
}

.qa-menu-item {
    flex: 0 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: background 0.2s;
    border: none;
    background: transparent;
    color: #555;
    min-width: 90px;
    border-bottom: 3px solid transparent;
}

.qa-menu-item:hover {
    background: #e9ecef;
}

.qa-menu-item.active {
    background: white;
    border-bottom-color: #667eea;
    color: #667eea;
}

.qa-menu-item .icon {
    font-size: 1.5rem;
}

.qa-menu-item .label {
    font-size: 0.75rem;
    font-weight: 500;
}

/* Content Area */
.qa-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.qa-section {
    display: none;
}

.qa-section.active {
    display: block;
}

/* Notepad Section */
.qa-notepad {
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 0;
}

.qa-note-tabs {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 0;
    position: relative;
}

.qa-note-tabs::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: #e0e0e0;
    z-index: 0;
}

.qa-note-tab {
    padding: 0.6rem 1rem;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-bottom: 2px solid #e0e0e0;
    border-radius: 6px 6px 0 0;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    white-space: nowrap;
    position: relative;
    z-index: 1;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.qa-note-tab:hover {
    background: #e9ecef;
    max-width: none;
}

.qa-note-tab.active {
    background: white;
    border-bottom: 2px solid white;
    font-weight: 600;
    color: #667eea;
    z-index: 2;
    max-width: none;
}

.qa-note-textarea {
    flex: 1;
    min-height: 300px;
    padding: 1rem;
    border: none;
    background: white;
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    resize: vertical;
    line-height: 1.6;
}

.qa-note-textarea:focus {
    outline: none;
}

.qa-note-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #7f8c8d;
    font-size: 0.85rem;
}

/* Calculator Sections */
.qa-calculator {
    max-width: 500px;
    margin: 0 auto;
}

.qa-calc-group {
    margin-bottom: 1.5rem;
}

.qa-calc-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #555;
    font-weight: 500;
    font-size: 0.95rem;
}

.qa-calc-group input,
.qa-calc-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
}

.qa-calc-group input:focus,
.qa-calc-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.qa-calc-btn {
    width: 100%;
    padding: 0.875rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
}

.qa-calc-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.qa-calc-btn:active {
    transform: translateY(0);
}

.qa-calc-result {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
    border-radius: 8px;
    border-left: 4px solid #667eea;
    display: none;
}

.qa-calc-result.active {
    display: block;
}

.qa-calc-result h4 {
    color: #667eea;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.qa-calc-result .value {
    font-size: 2rem;
    color: #2c3e50;
    font-weight: 600;
}

/* Converter Grid */
.qa-converter-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1rem;
    align-items: end;
}

.qa-converter-arrow {
    font-size: 1.5rem;
    color: #667eea;
    padding-bottom: 0.75rem;
}

/* Empty State */
.qa-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: #95a5a6;
}

.qa-empty .icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.qa-empty p {
    font-size: 1.1rem;
}

/* Scrollbar styling */
.qa-content::-webkit-scrollbar,
.qa-menu::-webkit-scrollbar,
.qa-note-tabs::-webkit-scrollbar {
    height: 8px;
    width: 8px;
}

.qa-content::-webkit-scrollbar-track,
.qa-menu::-webkit-scrollbar-track,
.qa-note-tabs::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.qa-content::-webkit-scrollbar-thumb,
.qa-menu::-webkit-scrollbar-thumb,
.qa-note-tabs::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.qa-content::-webkit-scrollbar-thumb:hover,
.qa-menu::-webkit-scrollbar-thumb:hover,
.qa-note-tabs::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Responsive */
@media (max-width: 768px) {
    .quick-access-modal {
        width: 95vw;
        max-height: 90vh;
    }

    .qa-menu-item {
        min-width: 70px;
        padding: 0.75rem 1rem;
    }

    .qa-menu-item .label {
        font-size: 0.7rem;
    }

    .quick-access-fab {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
}


/* Calculator List Section */
.qa-calculator-list {
    padding: 1.5rem;
    overflow-y: auto;
}

.qa-calculator-list h3 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
}

.qa-calc-category {
    margin-bottom: 2rem;
}

.qa-calc-category:last-child {
    margin-bottom: 0;
}

.qa-calc-category h4 {
    color: #667eea;
    font-size: 1rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e9ecef;
}

.qa-calc-links {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.5rem;
}

.qa-calc-links a {
    padding: 0.5rem 0.75rem;
    background: #f8f9fa;
    border-radius: 6px;
    text-decoration: none;
    color: #2c3e50;
    font-size: 0.9rem;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.qa-calc-links a:hover {
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
    border-color: #667eea;
    transform: translateX(3px);
}

@media (max-width: 768px) {
    .qa-calc-links {
        grid-template-columns: 1fr;
    }
}