/* IA Section Styles */
.ia-section {
    display: none;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px;
    animation: fadeIn 0.5s ease-in-out;
}

.ia-section.active {
    display: block;
}

/* Smooth container spacing */
.ia-container {
    animation: containerSlideIn 0.6s ease-out;
}

@keyframes containerSlideIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hide operations section when IA is active */
.main-content.hide-operations .top-section,
.main-content.hide-operations .bottom-section,
.main-content.hide-operations .status-section {
    display: none !important;
}

/* IA Container */
.ia-container {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

/* IA Header */
.ia-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    background: linear-gradient(135deg, var(--bg-card), rgba(0, 132, 237, 0.05));
}

.ia-title-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.ia-icon-wrapper {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), #00a0ff);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 132, 237, 0.3);
}

.ia-icon-wrapper i {
    font-size: 24px;
    color: var(--text-white);
}

.ia-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-white);
    margin: 0;
    display: block;
    width: 100%;
}

.ia-subtitle {
    font-size: 13px;
    color: var(--text-gray);
    display: block;
    margin-top: 4px;
    width: 100%;
}

.ia-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-header);
    border: 1px solid var(--border-color);
    border-radius: 20px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #00ff00;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(0, 255, 0, 0.7);
    }
    50% {
        opacity: 0.7;
        box-shadow: 0 0 0 8px rgba(0, 255, 0, 0);
    }
}

.status-text {
    font-size: 12px;
    color: var(--text-gray);
    font-weight: 500;
}

/* Asset Selector */
.ia-asset-selector {
    padding: 25px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.ia-label {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-white);
    margin-bottom: 15px;
}

.ia-select-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Filter Buttons */
.ia-asset-filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.ia-filter-btn {
    padding: 10px 18px;
    background: var(--bg-header);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    color: var(--text-gray);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ia-filter-btn:hover {
    border-color: var(--primary-color);
    color: var(--text-white);
    background: rgba(0, 132, 237, 0.1);
}

.ia-filter-btn.active {
    background: linear-gradient(135deg, var(--primary-color), #00a0ff);
    border-color: var(--primary-color);
    color: var(--text-white);
    box-shadow: 0 2px 10px rgba(0, 132, 237, 0.3);
}

.ia-asset-select {
    width: 100%;
    padding: 14px 18px;
    padding-right: 45px;
    background: var(--bg-header);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-white);
    font-size: 14px;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ffffff' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 18px center;
    background-size: 12px;
    transition: all 0.3s ease;
}

.ia-asset-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 132, 237, 0.15);
    background-color: rgba(0, 132, 237, 0.05);
}

.ia-asset-select:hover {
    border-color: var(--primary-color);
}

/* Signal Area */
.ia-signal-area {
    padding: 40px 30px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    min-height: 450px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.signal-container {
    width: 100%;
    max-width: 600px;
    text-align: center;
}

/* Signal Pending */
.signal-pending {
    padding: 40px 20px;
}

.pending-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-header);
    border: 2px dashed var(--border-color);
    border-radius: 50%;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.pending-icon i {
    font-size: 40px;
    color: var(--primary-color);
    opacity: 0.6;
}

.pending-text {
    font-size: 18px;
    color: var(--text-white);
    margin-bottom: 8px;
    font-weight: 500;
}

.pending-subtext {
    font-size: 14px;
    color: var(--text-gray);
}

/* Signal Active */
.signal-active {
    animation: signalAppear 0.8s ease-out;
}

@keyframes signalAppear {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.signal-animation-wrapper {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 0 auto 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.signal-pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid var(--primary-color);
    animation: pulseRing 2s ease-out infinite;
}

/* Buy signal - Green pulse */
.signal-animation-wrapper.buy .signal-pulse {
    border-color: #00ff88;
}

/* Sell signal - Red pulse */
.signal-animation-wrapper.sell .signal-pulse {
    border-color: #ff4444;
}

@keyframes pulseRing {
    0% {
        transform: scale(0.8);
        opacity: 1;
    }
    100% {
        transform: scale(1.4);
        opacity: 0;
    }
}

.signal-core {
    position: relative;
    z-index: 1;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), #00a0ff);
    box-shadow: 0 8px 30px rgba(0, 132, 237, 0.5);
    animation: corePulse 2s ease-in-out infinite;
}

/* Buy signal - Green core */
.signal-animation-wrapper.buy .signal-core {
    background: linear-gradient(135deg, #00ff88, #00cc6a);
    box-shadow: 0 8px 30px rgba(0, 255, 136, 0.5);
    animation: corePulseBuy 2s ease-in-out infinite;
}

/* Sell signal - Red core */
.signal-animation-wrapper.sell .signal-core {
    background: linear-gradient(135deg, #ff4444, #cc0000);
    box-shadow: 0 8px 30px rgba(255, 68, 68, 0.5);
    animation: corePulseSell 2s ease-in-out infinite;
}

@keyframes corePulse {
    0%, 100% {
        box-shadow: 0 8px 30px rgba(0, 132, 237, 0.5);
    }
    50% {
        box-shadow: 0 8px 40px rgba(0, 132, 237, 0.8);
    }
}

@keyframes corePulseBuy {
    0%, 100% {
        box-shadow: 0 8px 30px rgba(0, 255, 136, 0.5);
    }
    50% {
        box-shadow: 0 8px 40px rgba(0, 255, 136, 0.8);
    }
}

@keyframes corePulseSell {
    0%, 100% {
        box-shadow: 0 8px 30px rgba(255, 68, 68, 0.5);
    }
    50% {
        box-shadow: 0 8px 40px rgba(255, 68, 68, 0.8);
    }
}

.signal-icon {
    font-size: 60px;
    color: var(--text-white);
    animation: iconBounce 1s ease-in-out infinite;
}

/* Rotate the entire icon container for sell signals */
.signal-icon.sell {
    transform: rotate(180deg);
    animation: iconBounceSell 1s ease-in-out infinite;
}

@keyframes iconBounce {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-5px) rotate(0deg);
    }
}

@keyframes iconBounceSell {
    0%, 100% {
        transform: translateY(0) rotate(180deg);
    }
    50% {
        transform: translateY(-5px) rotate(180deg);
    }
}

/* Signal Content */
.signal-content {
    text-align: center;
}

.signal-type {
    margin-bottom: 25px;
}

.signal-badge {
    display: inline-block;
    padding: 14px 45px;
    border-radius: 30px;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    animation: badgeGlow 2s ease-in-out infinite;
    position: relative;
    overflow: hidden;
}

.signal-badge.buy {
    background: linear-gradient(135deg, #00ff88, #00cc6a);
    color: #000;
    box-shadow: 0 4px 20px rgba(0, 255, 136, 0.4);
}

.signal-badge.sell {
    background: linear-gradient(135deg, #ff4444, #cc0000);
    color: #fff;
    box-shadow: 0 4px 20px rgba(255, 68, 68, 0.4);
}

@keyframes badgeGlow {
    0%, 100% {
        filter: brightness(1);
    }
    50% {
        filter: brightness(1.2);
    }
}

.signal-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
    padding: 20px;
    background: var(--bg-header);
    border-radius: 10px;
}

.signal-asset,
.signal-confidence,
.signal-time {
    text-align: left;
}

.signal-label {
    display: block;
    font-size: 12px;
    color: var(--text-gray);
    margin-bottom: 5px;
}

.signal-value {
    display: block;
    font-size: 16px;
    color: var(--text-white);
    font-weight: 600;
}

.signal-message {
    padding: 20px;
    background: var(--bg-header);
    border-left: 4px solid var(--primary-color);
    border-radius: 8px;
    text-align: left;
}

.signal-message p {
    margin: 0;
    font-size: 14px;
    color: var(--text-gray);
    line-height: 1.6;
}

/* Control Button */
.ia-controls {
    display: flex;
    justify-content: center;
}

.ia-generate-btn {
    position: relative;
    padding: 20px 60px;
    background: linear-gradient(135deg, var(--primary-color), #00a0ff);
    border: none;
    border-radius: 50px;
    color: var(--text-white);
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
    overflow: hidden;
    box-shadow: 0 6px 25px rgba(0, 132, 237, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ia-generate-btn::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 ease;
}

.ia-generate-btn:hover:not(:disabled)::before {
    left: 100%;
}

.ia-generate-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 132, 237, 0.6);
}

.ia-generate-btn:active:not(:disabled) {
    transform: translateY(-1px);
}

.ia-generate-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-icon-wrapper {
    font-size: 22px;
}

.btn-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.loader-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--text-white);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.ia-generate-btn.loading .btn-text,
.ia-generate-btn.loading .btn-icon-wrapper {
    opacity: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .ia-section {
        padding: 0px 15px;
    }
    
    .ia-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .ia-title-wrapper {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 12px;
    }
    
    .ia-icon-wrapper {
        flex-shrink: 0;
        width: 45px;
        height: 45px;
    }
    
    .ia-icon-wrapper i {
        font-size: 20px;
    }
    
    .ia-title {
        flex: 1;
        min-width: calc(100% - 57px); /* 100% - ícone(45px) - gap(12px) */
        margin: 0;
        display: block;
        order: 1;
    }
    
    .ia-subtitle {
        flex: 1;
        min-width: calc(100% - 57px);
        margin-top: 4px;
        margin-left: 0;
        padding-left: 0;
        display: block;
        order: 2;
    }
    
    .ia-signal-area {
        padding: 20px;
        min-height: 300px;
    }
    
    .signal-animation-wrapper {
        width: 150px;
        height: 150px;
    }
    
    .signal-core {
        width: 120px;
        height: 120px;
    }
    
    .signal-icon {
        font-size: 50px;
    }
    
    .signal-badge {
        padding: 10px 30px;
        font-size: 20px;
    }
    
    .signal-info {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .ia-generate-btn {
        padding: 15px 40px;
        font-size: 14px;
    }
}

