/* Period Selector Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1;
}

.modal-content.period-selector {
    position: relative;
    z-index: 2;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 700px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
}

.close-btn:hover {
    background: #f3f4f6;
    color: #1f2937;
}

.modal-body {
    padding: 20px;
}

.selected-stock {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    padding: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    color: white;
}

.stock-label {
    font-size: 13px;
    opacity: 0.9;
}

.stock-symbol {
    font-size: 16px;
    font-weight: 700;
}

.presets-section h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.presets-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.preset-card {
    background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.preset-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

.preset-card.selected {
    border-color: #667eea;
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.25);
}

.preset-card.recommended {
    border-color: #10b981;
}

.preset-card.recommended.selected {
    border-color: #10b981;
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
}

.preset-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.preset-label {
    font-size: 14px;
    font-weight: 700;
    color: #1f2937;
}

.preset-badge {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.preset-badge.quick {
    background: #dbeafe;
    color: #1e40af;
}

.preset-badge.recommended {
    background: #d1fae5;
    color: #065f46;
}

.preset-badge.extended {
    background: #ede9fe;
    color: #6b21a8;
}

.preset-badge.longterm {
    background: #fef3c7;
    color: #92400e;
}

.preset-days {
    font-size: 12px;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 4px;
}

.preset-description {
    font-size: 11px;
    color: #6b7280;
    margin-bottom: 4px;
}

.preset-best-for {
    font-size: 10px;
    color: #374151;
}

.preset-pros {
    font-size: 10px;
    color: #10b981;
    font-weight: 500;
    margin-top: 4px;
}

.preset-warning {
    font-size: 10px;
    color: #f59e0b;
    font-weight: 500;
    margin-top: 4px;
}

.divider {
    text-align: center;
    margin: 16px 0;
    position: relative;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e5e7eb;
}

.divider span {
    position: relative;
    background: white;
    padding: 0 12px;
    color: #9ca3af;
    font-size: 12px;
    font-weight: 600;
}

.custom-section h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.date-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 10px;
}

.date-input-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.date-input-group label {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
}

.date-input {
    padding: 8px 10px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 13px;
    transition: all 0.2s;
}

.date-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.custom-info {
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

.custom-info.success {
    background: #d1fae5;
    color: #065f46;
}

.custom-info.warning {
    background: #fef3c7;
    color: #92400e;
}

.info-note {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px;
    background: #eff6ff;
    border-left: 3px solid #3b82f6;
    border-radius: 6px;
    margin-top: 16px;
    font-size: 12px;
    color: #1e40af;
}

.info-icon {
    font-size: 14px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 12px 20px;
    border-top: 1px solid #e5e7eb;
}

.btn-secondary {
    padding: 8px 16px;
    border: 2px solid #e5e7eb;
    background: white;
    color: #374151;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.btn-primary {
    padding: 8px 20px;
    border: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
    transform: translateY(-1px);
}

/* Responsive */
@media (max-width: 768px) {
    .presets-grid {
        grid-template-columns: 1fr;
    }

    .date-inputs {
        grid-template-columns: 1fr;
    }

    .modal-content.period-selector {
        width: 95%;
        max-height: 90vh;
    }

    .modal-body {
        padding: 16px;
    }
}
