/**
 * Common styles shared across all pages
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');

@font-face {
    font-family: "AlberNewBold";
    src: url("/static/fonts/AlberNew-Bold.ttf") format("truetype");
    font-weight: bold;
    font-style: normal;
}

:root {
    --gray-font: #6b7380;
    --background-color: #0b0f19;
    --secondary-color: #0f1524;
    --tertiary-color: #0b0f19;
    --accent-color: #3c0f14;
    --border-color: #141c2e;
    --input-border: #364153;
    --hover-bg: #101522;
    --menu-bg: #0f1523;
    --text-white: #ffffff;
    --text-gray: #6b7380;
    --gradient-start: #1a2233;
    --gradient-end: #0b0f19;
    --hover-gradient-start: #223044;
    --hover-gradient-end: #101828;
}

/* Common button styles */
.btn {
    border: none;
    outline: none;
    padding: 7.5px 12px;
    border-radius: 5px;
    font-family: "Inter", sans-serif;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(to bottom, var(--gradient-start) 0%, var(--gradient-end) 100%);
    color: var(--text-white);
    border: 1px solid var(--border-color);
}

.btn-primary:hover {
    background: linear-gradient(to bottom, var(--hover-gradient-start) 0%, var(--hover-gradient-end) 100%);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.1);
}

/* Common input styles */
.input {
    border: none;
    outline: none;
    color: var(--text-white);
    border-radius: 5px;
    padding: 12px;
    background-color: var(--tertiary-color);
    font-size: 16px;
    border: 2px solid var(--input-border);
    font-family: "Inter", sans-serif;
}

.input:focus {
    border-color: var(--text-gray);
}

/* Common panel styles */
.panel {
    background-color: var(--menu-bg);
    border-radius: 5px;
    padding: 12.5px;
    border: 1px solid var(--border-color);
}

/* Common text styles */
.text-title {
    font-family: "Inter", sans-serif;
    font-weight: 700;
    font-size: 36px;
    color: var(--text-white);
}

.text-label {
    font-family: "Inter", sans-serif;
    font-size: 16px;
    color: var(--text-white);
    display: block;
    margin-bottom: 7.5px;
    margin-top: 15px;
}

.text-mono {
    font-family: monospace;
    color: var(--text-gray);
    font-size: 12px;
}

/* Common layout utilities */
.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-column {
    display: flex;
    flex-direction: column;
}

.flex-row {
    display: flex;
    flex-direction: row;
}

.nowrap {
    white-space: nowrap;
}

/* Common hover effects */
.hover-effect {
    position: relative;
    overflow: hidden;
}

.hover-effect::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: transparent;
    transition: background-color 0.3s ease;
    pointer-events: none;
    z-index: 1;
}

.hover-effect:hover::before {
    background-color: rgba(0, 0, 0, 0.15);
    transition-duration: 0.2s;
}

/* Common scrollbar styles */
.custom-scrollbar::-webkit-scrollbar {
    display: none;
}

/* Common form styles */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 7.5px;
}

/* Common spacing */
.mt-15 { margin-top: 15px; }
.mb-15 { margin-bottom: 15px; }
.ml-15 { margin-left: 15px; }
.mr-15 { margin-right: 15px; }

.p-10 { padding: 10px; }
.p-15 { padding: 15px; }
.p-20 { padding: 20px; }

/* Toast Notification System */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    color: white;
    font-weight: 500;
    font-size: 0.95rem;
    opacity: 0;
    transform: translateY(100px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100000;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 250px;
    max-width: 400px;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-success {
    background: linear-gradient(135deg, #4ecdc4, #44a39d);
    border: 1px solid rgba(78, 205, 196, 0.3);
}

.toast-error {
    background: linear-gradient(135deg, #ff6b6b, #ee5a5a);
    border: 1px solid rgba(255, 107, 107, 0.3);
}

.toast-info {
    background: linear-gradient(135deg, #6c7a89, #5a6875);
    border: 1px solid rgba(108, 122, 137, 0.3);
}

.toast i {
    font-size: 1.2rem;
}

@media (max-width: 768px) {
    .toast {
        right: 1rem;
        left: 1rem;
        bottom: 1rem;
    }
}

/* Focus Indicators for Accessibility */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid rgba(255, 107, 107, 0.5);
    outline-offset: 2px;
}

/* Remove default outline, use custom */
button:focus,
a:focus,
input:focus,
select:focus {
    outline: none;
}

/* Ensure interactive elements are keyboard accessible */
[role="button"]:focus-visible,
.context-menu-item:focus-visible {
    outline: 3px solid rgba(255, 107, 107, 0.5);
    outline-offset: 2px;
}

/* ======================== */
/* Help FAB & Panel Styles  */
/* ======================== */

.help-fab {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8585 50%, #4ecdc4 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    cursor: pointer;
    box-shadow: 
        0 4px 20px rgba(255, 107, 107, 0.4),
        0 0 0 0 rgba(255, 107, 107, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 9999;
    border: none;
    outline: none;
}

.help-fab:hover {
    transform: scale(1.1) rotate(15deg);
    box-shadow: 
        0 6px 30px rgba(255, 107, 107, 0.5),
        0 0 0 8px rgba(255, 107, 107, 0.1);
}

.help-fab:active {
    transform: scale(0.95);
}

.help-fab.active {
    background: linear-gradient(135deg, #4ecdc4 0%, #44a39d 100%);
    box-shadow: 
        0 4px 20px rgba(78, 205, 196, 0.4),
        0 0 0 0 rgba(78, 205, 196, 0.4);
}

.help-fab.active:hover {
    box-shadow: 
        0 6px 30px rgba(78, 205, 196, 0.5),
        0 0 0 8px rgba(78, 205, 196, 0.1);
}

.help-fab i {
    transition: transform 0.3s ease;
}

.help-fab.active i::before {
    content: "\f00d"; /* fa-times */
}

/* Pulse animation on first load */
@keyframes helpPulse {
    0%, 100% {
        box-shadow: 
            0 4px 20px rgba(255, 107, 107, 0.4),
            0 0 0 0 rgba(255, 107, 107, 0.4);
    }
    50% {
        box-shadow: 
            0 4px 20px rgba(255, 107, 107, 0.4),
            0 0 0 12px rgba(255, 107, 107, 0);
    }
}

.help-fab.pulse {
    animation: helpPulse 2s ease-in-out 3;
}

/* Help Panel */
.help-panel {
    position: fixed;
    bottom: 6rem;
    right: 2rem;
    width: 380px;
    max-width: calc(100vw - 3rem);
    max-height: calc(100vh - 10rem);
    background: linear-gradient(135deg, rgba(15, 21, 35, 0.98), rgba(20, 26, 40, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    backdrop-filter: blur(20px);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.help-panel.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.help-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
}

.help-panel-header h3 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-white);
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.help-panel-header h3 i {
    color: #feca57;
    font-size: 1.1rem;
}

.help-panel-close {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-gray);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.help-panel-close:hover {
    background: rgba(255, 107, 107, 0.15);
    border-color: rgba(255, 107, 107, 0.3);
    color: #ff6b6b;
    transform: rotate(90deg);
}

.help-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.5rem;
}

.help-panel-body::-webkit-scrollbar {
    width: 4px;
}

.help-panel-body::-webkit-scrollbar-track {
    background: transparent;
}

.help-panel-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
}

.help-section {
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.help-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.help-section h4 {
    font-size: 0.85rem;
    font-weight: 600;
    color: #ff6b6b;
    margin: 0 0 0.75rem 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.help-section h4 i {
    font-size: 0.8rem;
    opacity: 0.8;
}

.help-section ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.help-section li {
    font-size: 0.9rem;
    color: var(--text-gray);
    line-height: 1.5;
    margin-bottom: 0.6rem;
    padding-left: 1rem;
    position: relative;
}

.help-section li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: rgba(255, 107, 107, 0.5);
    font-size: 0.75rem;
}

.help-section li:last-child {
    margin-bottom: 0;
}

.help-section li strong {
    color: var(--text-white);
    font-weight: 500;
}

.help-section kbd {
    display: inline-block;
    padding: 0.15rem 0.4rem;
    font-size: 0.75rem;
    font-family: monospace;
    color: var(--text-white);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.2);
}

.help-panel-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.help-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: rgba(78, 205, 196, 0.1);
    border: 1px solid rgba(78, 205, 196, 0.2);
    border-radius: 10px;
    color: #4ecdc4;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
}

.help-link:hover {
    background: rgba(78, 205, 196, 0.2);
    border-color: rgba(78, 205, 196, 0.4);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(78, 205, 196, 0.2);
}

.help-link:first-child {
    background: rgba(255, 107, 107, 0.1);
    border-color: rgba(255, 107, 107, 0.2);
    color: #ff6b6b;
}

.help-link:first-child:hover {
    background: rgba(255, 107, 107, 0.2);
    border-color: rgba(255, 107, 107, 0.4);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.2);
}

/* Help FAB & Panel responsive */
@media (max-width: 768px) {
    .help-fab {
        bottom: 1.5rem;
        right: 1.5rem;
        width: 52px;
        height: 52px;
    }
    
    .help-panel {
        bottom: 5.5rem;
        right: 1rem;
        left: 1rem;
        width: auto;
        max-width: none;
        max-height: calc(100vh - 8rem);
    }
}

@media (max-width: 480px) {
    .help-fab {
        bottom: 1rem;
        right: 1rem;
        width: 48px;
        height: 48px;
        font-size: 1.1rem;
    }
    
    .help-panel {
        bottom: 5rem;
        right: 0.75rem;
        left: 0.75rem;
        border-radius: 16px;
    }
    
    .help-panel-header {
        padding: 1rem 1.25rem;
    }
    
    .help-panel-body {
        padding: 0.75rem 1.25rem;
    }
    
    .help-section li {
        font-size: 0.85rem;
    }
}
