/* Custom CSS for Trading Dashboard - Template-based Notifications */

/* Chat chips styling */
.chat-chip {
    display: inline-flex;
    align-items: center;
    font-size: 0.85em;
    padding: 0.35em 0.6em;
    margin: 0.1em;
    background-color: #0d6efd !important;
    border-radius: 0.375rem;
    position: relative;
    animation: fadeInChip 0.3s ease-in;
    cursor: default;
}

.chat-chip .btn-close {
    margin-left: 0.4em;
    font-size: 0.7em;
    padding: 0;
    opacity: 0.8;
    transition: opacity 0.2s;
    cursor: pointer;
}

.chat-chip .btn-close:hover {
    opacity: 1;
    transform: scale(1.1);
}

.chat-chip:hover {
    background-color: #0b5ed7 !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

@keyframes fadeInChip {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Selected chats container */
.selected-chats {
    min-height: 2.8rem;
    padding: 0.6rem;
    background-color: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
    transition: all 0.3s;
    position: relative;
}

.selected-chats:empty::before {
    content: "Selected chats will appear here";
    color: #6c757d;
    font-style: italic;
    font-size: 0.9em;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.selected-chats:not(:empty) {
    border-color: #0d6efd;
    background-color: #e7f3ff;
}

/* Chat selection improvements */
.chat-selector {
    border-color: #28a745;
    transition: all 0.3s;
}

.chat-selector:focus {
    border-color: #20c997;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

.chat-selector option[style*="display: none"] {
    color: #6c757d;
    background-color: #f8f9fa;
}

/* Notification item cards */
.notification-item {
    transition: all 0.3s ease;
    border-left: 4px solid #28a745;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
}

.notification-item:hover {
    box-shadow: 0 6px 12px rgba(0,0,0,0.1);
    transform: translateY(-3px);
    border-left-color: #20c997;
}

.notification-item .card-body {
    padding: 1.25rem;
}

/* Template select styling */
.template-select {
    border-color: #6f42c1;
    transition: all 0.3s;
}

.template-select:focus {
    border-color: #6610f2;
    box-shadow: 0 0 0 0.2rem rgba(111, 66, 193, 0.25);
}

/* Add notification card */
#addNotificationCard {
    animation: slideDown 0.4s ease-out;
    border: 2px solid #28a745;
    background: linear-gradient(135deg, #ffffff 0%, #f0fff4 100%);
}

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

#addNotificationCard .card-header {
    background: linear-gradient(45deg, #28a745, #20c997) !important;
}

/* Success message styling */
.alert.position-fixed {
    animation: slideInRight 0.4s ease-out;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Add notification button */
#addNotificationBtn {
    background: linear-gradient(45deg, #28a745, #20c997);
    border: none;
    box-shadow: 0 3px 6px rgba(40, 167, 69, 0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

#addNotificationBtn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

#addNotificationBtn:hover::before {
    left: 100%;
}

#addNotificationBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(40, 167, 69, 0.4);
    background: linear-gradient(45deg, #218838, #1aa085);
}

/* Button improvements */
.btn-outline-success:hover {
    background-color: #28a745;
    transform: scale(1.05);
    box-shadow: 0 2px 6px rgba(40, 167, 69, 0.3);
}

.btn-outline-danger:hover {
    background-color: #dc3545;
    transform: scale(1.05);
    box-shadow: 0 2px 6px rgba(220, 53, 69, 0.3);
}

/* Loading states for buttons */
button[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
}

button .bi-hourglass-split {
    animation: spin 1s linear infinite;
}

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

/* Modal enhancements */
.modal-content {
    border: none;
    box-shadow: 0 15px 35px rgba(0,0,0,0.3);
    border-radius: 0.5rem;
}

.modal-header {
    background: linear-gradient(45deg, #0d6efd, #6610f2);
    color: white;
    border-bottom: none;
    border-radius: 0.5rem 0.5rem 0 0;
}

.modal-header .btn-close {
    filter: invert(1);
    opacity: 0.8;
}

.modal-header .btn-close:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* Form improvements */
.form-select:focus,
.form-control:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
    transform: translateY(-1px);
}

/* Alert improvements */
#noNotificationsAlert {
    background: linear-gradient(45deg, #17a2b8, #6f42c1);
    color: white;
    border: none;
    text-align: center;
    padding: 2rem;
    border-radius: 0.5rem;
    animation: pulse 2s ease-in-out infinite alternate;
}

@keyframes pulse {
    from {
        box-shadow: 0 2px 6px rgba(23, 162, 184, 0.3);
    }
    to {
        box-shadow: 0 6px 18px rgba(23, 162, 184, 0.6);
    }
}

/* Card header gradients */
.card-header.bg-info {
    background: linear-gradient(45deg, #17a2b8, #20c997) !important;
}

.card-header.bg-primary {
    background: linear-gradient(45deg, #0d6efd, #6610f2) !important;
}

.card-header.bg-success {
    background: linear-gradient(45deg, #28a745, #20c997) !important;
}

/* Responsive improvements */
@media (max-width: 768px) {
    .notification-item .row {
        flex-direction: column;
    }
    
    .notification-item .col-md-2 {
        margin-top: 1rem;
        text-align: left !important;
    }
    
    .chat-chip {
        font-size: 0.8em;
        margin: 0.05em;
    }
    
    .selected-chats {
        min-height: 3rem;
        padding: 0.4rem;
    }
    
    #addNotificationCard .row {
        flex-direction: column;
    }
    
    #addNotificationCard .col-md-2 button {
        width: 100%;
        margin-top: 0.5rem;
    }
}

/* Hover effects for interactive elements */
.clickable {
    cursor: pointer;
    transition: all 0.2s ease;
}

.clickable:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Template name highlighting */
.notification-item h6 {
    color: #6f42c1;
    font-weight: 600;
}

/* Chat selection container */
.chat-selection {
    background: rgba(248, 249, 250, 0.5);
    padding: 0.75rem;
    border-radius: 0.375rem;
    border: 1px solid #e9ecef;
    transition: all 0.3s;
}

.chat-selection:hover {
    background: rgba(233, 236, 239, 0.7);
    border-color: #dee2e6;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .selected-chats {
        background-color: #343a40;
        border-color: #495057;
        color: #e9ecef;
    }
    
    .selected-chats:not(:empty) {
        background-color: #1e3a5f;
        border-color: #0d6efd;
    }
    
    .notification-item {
        background: linear-gradient(135deg, #2d3748 0%, #4a5568 100%);
        color: #e2e8f0;
    }
    
    .chat-selection {
        background-color: rgba(52, 58, 64, 0.5);
        border-color: #495057;
        color: #e9ecef;
    }
}success:hover {
    background-color: #28a745;
    transform: scale(1.05);
}

.btn-outline-danger:hover {
    background-color: #dc3545;
    transform: scale(1.05);
}

/* Alert improvements */
#noNotificationsAlert {
    background: linear-gradient(45deg, #17a2b8, #6f42c1);
    color: white;
    border: none;
    text-align: center;
    padding: 2rem;
}

/* Card header gradients */
.card-header.bg-info {
    background: linear-gradient(45deg, #17a2b8, #20c997) !important;
}

.card-header.bg-primary {
    background: linear-gradient(45deg, #0d6efd, #6610f2) !important;
}

.card-header.bg-success {
    background: linear-gradient(45deg, #28a745, #20c997) !important;
}

/* Hover effects for interactive elements */
.clickable {
    cursor: pointer;
    transition: all 0.2s ease;
}

.clickable:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .selected-chats {
        background-color: #343a40;
        border-color: #495057;
    }
    
    .selected-chats:not(:empty) {
        background-color: #1e3a5f;
        border-color: #0d6efd;
    }
    
    .notification-item {
        background-color: #2d3748;
        color: #e2e8f0;
    }
}