@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@300;400;500&display=swap');

:root {
    /* Red Shell theme variables */
    --bg-color: #1a1414;
    --fg-color: #f0d6d6;
    --primary-color: #e74c3c;
    --output-color: #ff8f8f;
    --error-color: #ff4545;
    --header-color: #140c0c;
    --secondary-color: #9e2b2b;
    --highlight-color: #ff5252;
    --text-shadow: 0 0 5px rgba(255, 0, 0, 0.4);
    --sidebar-width: 250px;
    --header-height: 60px;
    --border-radius: 4px;
    --sidebar-bg: #251616;
    
    /* Bitcoin theme colors */
    --bitcoin-orange: #f7931a;
    --bitcoin-orange-light: #ff9f1a;
    --bitcoin-orange-dark: #d4851a;
    --bitcoin-glow: 0 0 10px rgba(247, 147, 26, 0.4);
    
    /* Amber theme colors for terminal effect */
    --amber-color: #ffbf00;
    --amber-light: #ffd633;
    --amber-dark: #cc9900;
    --amber-glow: 0 0 8px rgba(255, 191, 0, 0.4);
}

/* Base styles */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Fira Code', 'Courier New', monospace;
    margin: 0;
    padding: 0;
    background: var(--bg-color);
    color: var(--fg-color);
    line-height: 1.6;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Terminal effect with subtle scan lines */
body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.1) 50%);
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.2;
}

/* Header styling */
header {
    background-color: var(--header-color);
    color: var(--fg-color);
    height: var(--header-height);
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(231, 76, 60, 0.3);
    z-index: 10;
    border-bottom: 1px solid var(--primary-color);
}

h1, h2 {
    margin: 0;
    text-shadow: var(--text-shadow);
}

h1 {
    font-size: 1.4rem;
    font-family: 'Fira Code', 'Courier New', monospace;
    color: var(--primary-color);
    letter-spacing: 1px;
}

h1 span {
    font-weight: 300;
    opacity: 0.8;
    color: var(--amber-dark);
    font-size: 0.9rem;
}

/* Main container */
.main-container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Sidebar styling */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: 1px solid rgba(231, 76, 60, 0.3);
    overflow-y: auto;
    padding: 1rem 0;
    display: flex;
    flex-direction: column;
}

.app-list-heading {
    padding: 0.5rem 1rem;
    margin: 0.5rem 0;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--primary-color);
    font-weight: 500;
    letter-spacing: 1.5px;
    text-shadow: var(--text-shadow);
}

.app-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.app-nav li {
    margin: 0;
    padding: 0;
}

.app-nav a {
    display: block;
    padding: 0.6rem 1rem;
    text-decoration: none;
    color: var(--fg-color);
    border-left: 3px solid transparent;
    transition: all 0.2s;
    text-shadow: var(--text-shadow);
}

.app-nav a:hover {
    background: rgba(231, 76, 60, 0.15);
    color: var(--highlight-color);
}

.app-nav a.active {
    background: rgba(231, 76, 60, 0.2);
    border-left-color: var(--primary-color);
    font-weight: 500;
    color: var(--primary-color);
}

.sidebar-footer {
    margin-top: auto;
    padding: 1rem;
    font-size: 0.8rem;
    text-align: center;
    color: rgba(240, 214, 214, 0.6);
    border-top: 1px solid rgba(231, 76, 60, 0.3);
}

/* Content area */
.content {
    flex: 1;
    overflow: hidden;
    background-color: var(--bg-color);
}

iframe {
    width: 100%;
    height: 100%;
    border: none;
    background-color: var(--bg-color);
}

/* Button styling */
.btn {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
    font-family: 'Fira Code', 'Courier New', monospace;
    text-shadow: var(--text-shadow);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    border: none;
}

.btn:hover {
    background: var(--highlight-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

.btn-sm {
    padding: 0.3rem 0.8rem;
    font-size: 0.8rem;
}

/* Stop button styling - always red */
.stop-button {
    background: #dc3545 !important;
    color: white !important;
}

.stop-button:hover {
    background: #c82333 !important;
}

/* Starting/Loading button styling - neutral gray */
.starting-button {
    background: #6c757d !important;
    color: white !important;
    cursor: not-allowed !important;
}

.starting-button:hover {
    background: #6c757d !important;
    transform: none !important;
}

/* Claim button styling - bitcoin orange theme */
#claim-btn {
    background: var(--bitcoin-orange) !important;
    color: white !important;
    margin-left: 8px !important;
    border: 1px solid var(--bitcoin-orange-dark) !important;
}

#claim-btn:hover {
    background: var(--bitcoin-orange-light) !important;
    border-color: var(--bitcoin-orange-light) !important;
    box-shadow: var(--bitcoin-glow) !important;
}

/* Check bitcoin button styling */
#check-bitcoin-btn {
    background: var(--sidebar-bg) !important;
    color: var(--fg-color) !important;
    border: 1px solid var(--border-color) !important;
}

#check-bitcoin-btn:hover {
    background: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: white !important;
}

#check-bitcoin-btn:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
}

#check-bitcoin-btn:disabled:hover {
    background: var(--sidebar-bg) !important;
    border-color: var(--border-color) !important;
    color: var(--fg-color) !important;
    transform: none !important;
}

/* Mobile sidebar toggle */
.sidebar-toggle {
    display: none;
    cursor: pointer;
    padding: 0.5rem;
    margin-right: 0.5rem;
}

.sidebar-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--primary-color);
    margin: 4px 0;
    transition: all 0.3s;
}

/* Hide scrollbars while keeping content scrollable */
::-webkit-scrollbar {
    width: 0px;
    height: 0px;
    background: transparent;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: transparent;
}

/* For Firefox - hide scrollbars */
* {
    scrollbar-width: none;
}

/* Ensure IE/Edge compatibility */
body {
    -ms-overflow-style: none;
}

/* Mobile styles */
@media (max-width: 768px) {
    .sidebar-toggle {
        display: block;
    }
    
    .sidebar {
        position: fixed;
        left: -100%;
        top: var(--header-height);
        height: calc(100vh - var(--header-height));
        z-index: 5;
        transition: left 0.3s ease;
        box-shadow: 2px 0 10px rgba(231, 76, 60, 0.4);
    }
    
    .sidebar.active {
        left: 0;
    }
    
    body:after {
        content: '';
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.7);
        z-index: 4;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s;
    }
    
    body.sidebar-open:after {
        opacity: 1;
        pointer-events: auto;
    }
    
    .sidebar-toggle span:nth-child(1) {
        transform: rotate(0) translateY(0);
    }
    
    .sidebar-toggle span:nth-child(2) {
        opacity: 1;
    }
    
    .sidebar-toggle span:nth-child(3) {
        transform: rotate(0) translateY(0);
    }
    
    body.sidebar-open .sidebar-toggle span:nth-child(1) {
        transform: rotate(45deg) translateY(6px);
    }
    
    body.sidebar-open .sidebar-toggle span:nth-child(2) {
        opacity: 0;
    }
    
    body.sidebar-open .sidebar-toggle span:nth-child(3) {
        transform: rotate(-45deg) translateY(-6px);
    }
}

/* Special Red aesthetic elements */
.app-nav a::before {
    display: none !important;
    content: none !important;
}

/* Helper classes */
.text-red {
    color: var(--primary-color);
}

.text-glow {
    text-shadow: var(--text-shadow);
}

/* Logo style */
h1 .emoji {
    margin-right: 8px;
    filter: drop-shadow(0 0 3px rgba(231, 76, 60, 0.6));
}

/* WinBox red border and glow */
.winbox.red-glow {
    border: 2px solid #e74c3c !important;
    box-shadow: 0 0 20px rgba(231, 76, 60, 0.4), 
                0 0 40px rgba(231, 76, 60, 0.2) !important;
}

/* Toast notification system */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    pointer-events: none;
}

.toast {
    background: var(--sidebar-bg);
    border: 1px solid var(--primary-color);
    border-radius: var(--border-radius);
    padding: 12px 16px;
    margin-bottom: 10px;
    min-width: 300px;
    max-width: 400px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transform: translateX(100%);
    transition: all 0.3s ease;
    pointer-events: auto;
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.4;
    position: relative;
    overflow: hidden;
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    border-color: #28a745;
    background: linear-gradient(135deg, var(--sidebar-bg), rgba(40, 167, 69, 0.1));
}

.toast.error {
    border-color: var(--error-color);
    background: linear-gradient(135deg, var(--sidebar-bg), rgba(255, 69, 69, 0.1));
}

.toast.warning {
    border-color: #ffc107;
    background: linear-gradient(135deg, var(--sidebar-bg), rgba(255, 193, 7, 0.1));
}

.toast.info {
    border-color: #17a2b8;
    background: linear-gradient(135deg, var(--sidebar-bg), rgba(23, 162, 184, 0.1));
}

/* Bitcoin-themed toast variants */
.toast.bitcoin-info {
    border-color: var(--bitcoin-orange);
    background: linear-gradient(135deg, var(--sidebar-bg), rgba(247, 147, 26, 0.1));
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), var(--bitcoin-glow);
}

.toast.bitcoin-warning {
    border-color: var(--bitcoin-orange-light);
    background: linear-gradient(135deg, var(--sidebar-bg), rgba(247, 147, 26, 0.15));
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), var(--bitcoin-glow);
    border-width: 2px;
}

.toast.bitcoin-critical {
    border-color: var(--bitcoin-orange-light);
    background: linear-gradient(135deg, var(--sidebar-bg), rgba(247, 147, 26, 0.2));
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4), var(--bitcoin-glow), 0 0 20px rgba(247, 147, 26, 0.3);
    border-width: 3px;
    animation: bitcoin-pulse 2s infinite;
}

@keyframes bitcoin-pulse {
    0%, 100% { 
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4), var(--bitcoin-glow), 0 0 20px rgba(247, 147, 26, 0.3);
    }
    50% { 
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4), var(--bitcoin-glow), 0 0 30px rgba(247, 147, 26, 0.5);
    }
}

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

.toast-title {
    font-weight: 500;
    color: var(--fg-color);
    text-shadow: var(--text-shadow);
}

.toast-close {
    background: none;
    border: none;
    color: var(--fg-color);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.toast-close:hover {
    opacity: 1;
}

.toast-body {
    color: rgba(240, 214, 214, 0.9);
    word-wrap: break-word;
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: var(--primary-color);
    transition: width linear;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}

.toast.success .toast-progress {
    background: #28a745;
}

.toast.error .toast-progress {
    background: var(--error-color);
}

.toast.warning .toast-progress {
    background: #ffc107;
}

.toast.info .toast-progress {
    background: #17a2b8;
}

.toast.bitcoin-info .toast-progress {
    background: var(--bitcoin-orange);
}

.toast.bitcoin-warning .toast-progress {
    background: var(--bitcoin-orange-light);
}

.toast.bitcoin-critical .toast-progress {
    background: linear-gradient(90deg, var(--bitcoin-orange), var(--bitcoin-orange-light));
}

/* Celebration toast - special red for address found */
.toast.celebration {
    border-color: #ff1744 !important;
    background: linear-gradient(135deg, var(--sidebar-bg), rgba(255, 23, 68, 0.2), rgba(231, 76, 60, 0.1)) !important;
    box-shadow: 
        0 6px 20px rgba(0, 0, 0, 0.4),
        0 0 30px rgba(255, 23, 68, 0.6),
        0 0 60px rgba(231, 76, 60, 0.3) !important;
    border-width: 3px !important;
    animation: celebration-pulse 1.5s infinite, celebration-sparkle 3s infinite !important;
    position: relative !important;
    overflow: visible !important;
}

.toast.celebration .toast-title {
    color: #ff1744 !important;
    text-shadow: 0 0 8px rgba(255, 23, 68, 0.8) !important;
    font-weight: 700 !important;
}

.toast.celebration .toast-body {
    color: #fff !important;
    font-weight: 600 !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7) !important;
    background: linear-gradient(90deg, #ff1744, #ff4569, #ff1744) !important;
    background-size: 200% 100% !important;
    animation: celebration-text-shimmer 2s infinite !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
}

.toast.celebration .toast-progress {
    background: linear-gradient(90deg, #ff1744, #ff4569, #e74c3c) !important;
    box-shadow: 0 0 10px rgba(255, 23, 68, 0.8) !important;
}

/* Special celebration animations */
@keyframes celebration-pulse {
    0%, 100% { 
        box-shadow: 
            0 6px 20px rgba(0, 0, 0, 0.4),
            0 0 30px rgba(255, 23, 68, 0.6),
            0 0 60px rgba(231, 76, 60, 0.3);
        transform: scale(1);
    }
    50% { 
        box-shadow: 
            0 8px 25px rgba(0, 0, 0, 0.5),
            0 0 40px rgba(255, 23, 68, 0.8),
            0 0 80px rgba(231, 76, 60, 0.5);
        transform: scale(1.02);
    }
}

@keyframes celebration-sparkle {
    0%, 100% { filter: brightness(1) saturate(1); }
    25% { filter: brightness(1.2) saturate(1.3); }
    50% { filter: brightness(1.1) saturate(1.2); }
    75% { filter: brightness(1.3) saturate(1.4); }
}

@keyframes celebration-text-shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Add sparkle pseudo-elements */
.toast.celebration::before {
    content: "✨";
    position: absolute;
    top: -10px;
    right: -10px;
    font-size: 20px;
    animation: celebration-rotate 2s infinite;
    filter: drop-shadow(0 0 5px rgba(255, 23, 68, 0.8));
}

.toast.celebration::after {
    content: "🍒";
    position: absolute;
    bottom: -10px;
    left: -10px;
    font-size: 16px;
    animation: celebration-bounce 1.5s infinite;
    filter: drop-shadow(0 0 5px rgba(231, 76, 60, 0.8));
}

@keyframes celebration-rotate {
    0% { transform: rotate(0deg) scale(1); }
    25% { transform: rotate(90deg) scale(1.2); }
    50% { transform: rotate(180deg) scale(1); }
    75% { transform: rotate(270deg) scale(1.2); }
    100% { transform: rotate(360deg) scale(1); }
}

@keyframes celebration-bounce {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-5px) scale(1.1); }
}

/* Toast action buttons */
.toast-actions {
    padding: 8px 0 0 0;
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.toast-button {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.toast-button.primary {
    background: #3498db;
    color: white;
}

.toast-button.primary:hover {
    background: #2980b9;
}

.toast-button.warning {
    background: #f39c12;
    color: white;
}

.toast-button.warning:hover {
    background: #e67e22;
}

.toast-button.danger {
    background: #e74c3c;
    color: white;
}

.toast-button.danger:hover {
    background: #c0392b;
}

.toast-button.bitcoin {
    background: var(--bitcoin-orange);
    color: white;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow: 0 2px 4px rgba(247, 147, 26, 0.3);
}

.toast-button.bitcoin:hover {
    background: var(--bitcoin-orange-light);
    box-shadow: 0 3px 6px rgba(247, 147, 26, 0.4), var(--bitcoin-glow);
    transform: translateY(-2px);
}

/* ============================================================================
   WinBox Rednode Theme
   ============================================================================ */

/* Main WinBox styling with red borders and amber text */
.rednode-theme.wb, .rednode-theme.winbox {
    border: 2px solid var(--primary-color) !important;
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.15) !important;
    background: var(--bg-color) !important;
}

/* Header styling with amber text and red background */
.rednode-theme .wb-header {
    background: var(--header-color) !important;
    color: var(--amber-color) !important;
    border-bottom: 1px solid #e74c3c4d !important;
    font-family: 'Fira Code', 'Courier New', monospace !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    text-shadow: var(--amber-glow) !important;
    box-shadow: 0 1px 4px rgba(231, 76, 60, 0.15) !important;
}

/* Window controls container - prevent hover backgrounds */
.rednode-theme .wb-control {
    background: transparent !important;
}

.rednode-theme .wb-control:hover {
    background: transparent !important;
}

/* Prevent header hover background changes */
.rednode-theme .wb-header:hover {
    background: var(--header-color) !important;
}

/* Individual button styling - amber colored icons using CSS filter */
.rednode-theme .wb-min,
.rednode-theme .wb-max, 
.rednode-theme .wb-full,
.rednode-theme .wb-close {
    /* Convert default icons to amber using CSS filter */
    filter: brightness(0) saturate(100%) invert(69%) sepia(99%) saturate(527%) hue-rotate(5deg) brightness(102%) contrast(101%) !important;
    border: none !important;
    background-color: transparent !important;
    transition: all 0.2s ease !important;
}

/* Individual button hover effects - only affect the specific button being hovered */
.rednode-theme .wb-min:hover {
    filter: brightness(0) saturate(100%) invert(87%) sepia(99%) saturate(527%) hue-rotate(5deg) brightness(110%) contrast(101%) !important;
    background-color: rgba(255, 191, 0, 0.1) !important;
}

.rednode-theme .wb-max:hover {
    filter: brightness(0) saturate(100%) invert(87%) sepia(99%) saturate(527%) hue-rotate(5deg) brightness(110%) contrast(101%) !important;
    background-color: rgba(255, 191, 0, 0.1) !important;
}

.rednode-theme .wb-full:hover {
    filter: brightness(0) saturate(100%) invert(87%) sepia(99%) saturate(527%) hue-rotate(5deg) brightness(110%) contrast(101%) !important;
    background-color: rgba(255, 191, 0, 0.1) !important;
}

.rednode-theme .wb-close:hover {
    filter: brightness(0) saturate(100%) invert(87%) sepia(99%) saturate(527%) hue-rotate(5deg) brightness(110%) contrast(101%) !important;
    background-color: rgba(255, 191, 0, 0.1) !important;
}

/* Body content area */
.rednode-theme .wb-body {
    background: #000 !important;
    color: var(--amber-color) !important;
    font-family: 'Fira Code', 'Courier New', monospace !important;
    overflow-y: auto !important;
}

/* Ensure embedded iframes inherit dark background */
.rednode-theme .wb-body iframe {
    background: #000 !important;
}

/* Resize handle styling */
.rednode-theme .wb-resize {
    background: var(--primary-color) !important;
    opacity: 0.7 !important;
}

.rednode-theme .wb-resize:hover {
    opacity: 1 !important;
}

/* Glow effect for active windows */
.rednode-glow.wb, .rednode-glow.winbox, .winbox.rednode-glow {
    box-shadow: 0 0 20px rgba(231, 76, 60, 0.5), 0 0 40px rgba(231, 76, 60, 0.3) !important;
    animation: rednode-pulse 3s ease-in-out infinite !important;
}

@keyframes rednode-pulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(231, 76, 60, 0.5), 0 0 40px rgba(231, 76, 60, 0.3);
    }
    50% {
        box-shadow: 0 0 30px rgba(231, 76, 60, 0.7), 0 0 60px rgba(231, 76, 60, 0.4);
    }
}

/* Modal overlay styling */
.rednode-theme.wb-modal {
    background: rgba(26, 20, 20, 0.8) !important;
    backdrop-filter: blur(2px) !important;
}

/* Focus styling */
.rednode-theme.wb-focus {
    border-color: var(--amber-color) !important;
    box-shadow: 0 0 20px rgba(255, 191, 0, 0.4), 0 4px 20px rgba(231, 76, 60, 0.3) !important;
}

/* Title text styling */
.rednode-theme .wb-title {
    color: var(--amber-color) !important;
    text-shadow: var(--amber-glow) !important;
    font-weight: 500 !important;
}
