/**
 * COMPONENTS
 * Стили для компонентов: модальные окна, инпуты, loader
 */

/* Модальные инпуты */
.modal-input {
    background-color: #F8FAFC;
    border: 1px solid #E2E8F0;
    transition: all 0.2s;
    padding: 14px 12px; 
    font-size: 15px;
}

.modal-input:focus {
    background-color: #FFFFFF;
    border-color: #0F172A;
    box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.1);
    outline: none;
}

/* Date input with plan indicators */
input[type="date"].has-plans {
    position: relative;
}

/* Loader (spinner) */
.loader {
    border: 3px solid #f3f3f3;
    border-radius: 50%;
    border-top: 3px solid #0f172a;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}

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

/* Анимация для мобильного меню */
.slide-in-enter-active, 
.slide-in-leave-active { 
    transition: transform 0.3s ease; 
}

.slide-in-enter-start, 
.slide-in-leave-end { 
    transform: translateX(-100%); 
}

/* Превью скриншотов */
.screenshot-preview {
    display: inline-block;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 6px;
    overflow: hidden;
}

.screenshot-preview:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.screenshot-preview img {
    border: 2px solid #E2E8F0;
    transition: border-color 0.2s ease;
}

.screenshot-preview:hover img {
    border-color: #94A3B8;
}

/* Компактный календарь */
.calendar-cell {
    height: 90px; /* Компактная фиксированная высота */
    max-height: 90px;
}

/* Подсветка выбранной даты в календаре */
.calendar-cell-selected {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.5);
    transform: scale(1.02);
}

/* Анимация появления списка сделок */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.trades-list-animated {
    animation: slideDown 0.3s ease-out;
}
/* ==========================================
   TRADING PLAN STYLES
   ========================================== */

/* Workspace tabs */
.workspace-tabs {
    scrollbar-width: none;
}

.workspace-tabs::-webkit-scrollbar {
    display: none;
}

/* Instrument card hover effect */
.instrument-card {
    transition: all 0.3s ease;
}

.instrument-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

/* Bias button transitions */
.bias-button {
    transition: all 0.2s ease;
}

.bias-button:active {
    transform: scale(0.95);
}

/* Screenshot grid */
.screenshot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: 0.5rem;
}

/* Screenshot hover effect */
.screenshot-item {
    position: relative;
    overflow: hidden;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.screenshot-item:hover {
    transform: scale(1.05);
    z-index: 10;
}

.screenshot-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* History sidebar scrollbar - invisible */
.history-sidebar {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
    overflow-x: hidden; /* No horizontal scroll */
}

.history-sidebar::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

/* Accordion animations for instruments */
.accordion-header {
    transition: all 0.2s ease;
}

.accordion-header:hover {
    background-color: rgba(248, 250, 252, 0.8);
}

.accordion-header.expanded {
    background-color: rgba(239, 246, 255, 0.5);
}

/* Smooth transitions for accordion content */
.accordion-content {
    transition: max-height 0.3s ease-out, opacity 0.2s ease-out;
}

/* Loading skeleton for trading plan */
.skeleton {
    animation: skeleton-loading 1.5s linear infinite;
    background: linear-gradient(
        90deg,
        rgba(226, 232, 240, 0.2) 0%,
        rgba(226, 232, 240, 0.5) 50%,
        rgba(226, 232, 240, 0.2) 100%
    );
    background-size: 200% 100%;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Date picker with plan indicator */
input[type="date"].has-plan {
    position: relative;
}

input[type="date"].has-plan::before {
    content: '';
    position: absolute;
    top: 2px;
    right: 2px;
    width: 6px;
    height: 6px;
    background-color: #3b82f6;
    border-radius: 50%;
    z-index: 10;
}

/* Workspace notes textarea */
.workspace-notes-textarea {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
    line-height: 1.6;
    scrollbar-width: thin;
}

.workspace-notes-textarea::-webkit-scrollbar {
    width: 8px;
}

.workspace-notes-textarea::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.workspace-notes-textarea::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.workspace-notes-textarea::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}


/* File preview grid */
.file-preview-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Loading overlay for file uploads */
.upload-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
}

/* Forex calendar iframe */
.forex-calendar-container {
    position: relative;
    overflow: hidden;
}

.forex-calendar-container iframe {
    border: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .screenshot-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }
    
    .history-sidebar {
        max-height: 200px;
    }
}

/* Smooth transitions for all interactive elements */
button, select, input, textarea {
    transition: all 0.2s ease;
}

/* Focus states */
input:focus,
textarea:focus,
select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Sidebar footer: единый вид и высота */
.sidebar-footer {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.sidebar-footer .footer-email {
    font-size: 10px;
    color: #94a3b8;
    padding: 0 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-footer .email-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 1rem;
}
.sidebar-footer .email-avatar {
    width: 24px;
    height: 24px;
    border-radius: 9999px;
    background: #e2e8f0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    font-size: 12px;
}
