/* Flow Card Styles */
.flow-card {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    border: 1px solid #e5e7eb;
    padding: 1.25rem;
    transition: all 0.3s ease;
}

.flow-card:hover {
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

@media (prefers-color-scheme: dark) {
    .flow-card {
        background: #1f2937;
        border-color: #374151;
    }
}

/* Balance Card for Equal Heights */
.balance-card {
    display: flex;
    flex-direction: column;
    min-height: 550px;
}

.balance-card .content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.balance-card .action-area {
    margin-top: auto;
}

/* Button Styles */
.btn-encode {
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
    color: white;
    font-weight: 600;
    padding: 0.6rem 1.2rem;
    border-radius: 0.5rem;
    box-shadow: 0 2px 10px rgba(37, 99, 235, 0.25);
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
}

.btn-encode:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.35);
}

.btn-decode {
    background: linear-gradient(135deg, #9333ea 0%, #a855f7 100%);
    color: white;
    font-weight: 600;
    padding: 0.6rem 1.2rem;
    border-radius: 0.5rem;
    box-shadow: 0 2px 10px rgba(147, 51, 234, 0.25);
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    width: 100%;
}

.btn-decode:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(147, 51, 234, 0.35);
}

.btn-action {
    background: #f3f4f6;
    color: #1f2937;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 0.4rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-action:hover {
    background: #e5e7eb;
}

@media (prefers-color-scheme: dark) {
    .btn-action {
        background: #374151;
        color: #f3f4f6;
    }
    .btn-action:hover {
        background: #4b5563;
    }
}

/* Textarea Styles */
.txt-area {
    width: 100%;
    background: #f9fafb;
    color: #1f2937;
    border: 2px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 0.75rem;
    font-family: 'Monaco', monospace;
    font-size: 0.8rem;
    resize: none;
    transition: all 0.3s ease;
    line-height: 1.5;
}

.txt-area:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background: #ffffff;
}

@media (prefers-color-scheme: dark) {
    .txt-area {
        background: #111827;
        color: #f3f4f6;
        border-color: #374151;
    }
    .txt-area:focus {
        border-color: #3b82f6;
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
        background: #1f2937;
    }
}

/* Format Selector */
.format-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.fmt-btn {
    padding: 0.5rem 0.875rem;
    border-radius: 0.4rem;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    border: 2px solid;
    transition: all 0.3s ease;
}

.fmt-btn.active {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.fmt-btn.inactive {
    background: #f3f4f6;
    color: #4b5563;
    border-color: #d1d5db;
}

.fmt-btn.inactive:hover {
    border-color: #60a5fa;
    background: #f0f1f3;
}

@media (prefers-color-scheme: dark) {
    .fmt-btn.inactive {
        background: #374151;
        color: #d1d5db;
        border-color: #4b5563;
    }
    .fmt-btn.inactive:hover {
        background: #4b5563;
    }
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    padding: 0.875rem 1.25rem;
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    max-width: 24rem;
    transition: all 0.3s ease;
    animation: slideIn 0.4s ease-out;
    z-index: 999;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast-success {
    background: #22c55e;
}

.toast-error {
    background: #ef4444;
}

.toast-info {
    background: #3b82f6;
}

/* Status Badges */
.stat-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.7rem;
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-radius: 0.4rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #1e40af;
}

@media (prefers-color-scheme: dark) {
    .stat-badge {
        background: linear-gradient(135deg, rgba(29, 78, 216, 0.3) 0%, rgba(30, 144, 255, 0.3) 100%);
        color: #93c5fd;
    }
}

.stat-badge-blue {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
}

.stat-badge-green {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    color: #15803d;
}

@media (prefers-color-scheme: dark) {
    .stat-badge-green {
        background: linear-gradient(135deg, rgba(34, 197, 94, 0.3) 0%, rgba(74, 222, 128, 0.3) 100%);
        color: #86efac;
    }
}

/* Code Highlight Override */
.hljs {
    background: #111827 !important;
    color: #f3f4f6 !important;
    padding: 0.75rem !important;
    border-radius: 0.4rem !important;
    font-family: 'Monaco', monospace !important;
    font-size: 0.75rem !important;
    overflow: auto !important;
}

/* Smooth transitions */
* {
    transition-property: background-color, border-color, color;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .balance-card {
        min-height: auto;
    }
}

/* SVG Icon Styles */
svg.icon {
    display: inline-block;
    width: 1em;
    height: 1em;
    vertical-align: -0.125em;
    fill: currentColor;
    overflow: visible;
}

svg.icon-sm {
    width: 0.875em;
    height: 0.875em;
}

svg.icon-md {
    width: 1.25em;
    height: 1.25em;
}

svg.icon-lg {
    width: 1.5em;
    height: 1.5em;
}

svg.icon-xl {
    width: 2em;
    height: 2em;
}

/* Icon spin animation for loading */
svg.icon-spin {
    animation: iconSpin 1s linear infinite;
}

@keyframes iconSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Icon colors */
svg.icon-primary {
    color: #2563eb;
}

svg.icon-success {
    color: #22c55e;
}

svg.icon-error {
    color: #ef4444;
}

svg.icon-warning {
    color: #f59e0b;
}

svg.icon-info {
    color: #06b6d4;
}

svg.icon-white {
    color: #ffffff;
}

svg.icon-gray {
    color: #6b7280;
}

svg.icon-text-gray {
    color: #4b5563;
}

/* Icon hover effects */
.icon-hover svg.icon {
    transition: all 0.3s ease;
}

.icon-hover:hover svg.icon {
    transform: scale(1.1);
}

/* Icon in buttons */
button svg.icon {
    margin-right: 0.3rem;
}
