/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Custom Properties - Trending colors 2025 */
:root {
    /* New primary palette */
    --primary-gradient: linear-gradient(135deg, #800F2F 0%, #9A1B3A 50%, #B2224B 100%);
    --secondary-gradient: linear-gradient(135deg, #B2224B 0%, #9A1B3A 50%, #800F2F 100%);
    --accent-color: #800F2F;
    --accent-secondary: #B2224B;
    
    /* Background colors - DARK THEME (domyślny) */
    --bg-primary: #000000;
    --bg-glass: rgba(128, 15, 47, 0.08);
    --bg-card: rgba(255, 255, 255, 0.05);
    --bg-card-hover: rgba(255, 255, 255, 0.08);
    
    /* Text colors - DARK THEME (domyślny) */
    --text-primary: #ffffff;
    --text-secondary: #800F2F;
    --text-muted: #8b8ca3;
    
    /* Shadow & glow effects */
    --shadow-primary: 0 20px 40px rgba(128, 15, 47, 0.2);
    --shadow-secondary: 0 10px 30px rgba(178, 34, 75, 0.15);
    --glow-primary: 0 0 20px rgba(128, 15, 47, 0.3);
    --glow-secondary: 0 0 15px rgba(178, 34, 75, 0.25);
    
    /* Border radius */
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    
    /* Animations */
    --animation-smooth: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --animation-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* LIGHT THEME - jasny motyw */
:root.light-theme {
    /* Background colors - LIGHT THEME */
    --bg-primary: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    --bg-glass: rgba(128, 15, 47, 0.12);
    --bg-card: rgba(255, 255, 255, 0.85);
    --bg-card-hover: rgba(255, 255, 255, 0.95);
    
    /* Text colors - LIGHT THEME */
    --text-primary: #1e293b;
    --text-secondary: #800F2F;
    --text-muted: #64748b;
    
    /* Shadow & glow effects - LIGHT THEME */
    --shadow-primary: 0 20px 40px rgba(128, 15, 47, 0.15);
    --shadow-secondary: 0 10px 30px rgba(178, 34, 75, 0.12);
    --glow-primary: 0 0 20px rgba(128, 15, 47, 0.2);
    --glow-secondary: 0 0 15px rgba(178, 34, 75, 0.18);
}

/* Dodatkowe style dla jasnego motywu */
:root.light-theme .form-container {
    border: 1px solid rgba(184, 169, 255, 0.3);
    backdrop-filter: blur(20px);
}

:root.light-theme .form-container::before {
    opacity: 0.1;
}

:root.light-theme .step-card {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(184, 169, 255, 0.2);
    color: #1e293b;
}

:root.light-theme .step-card::before {
    opacity: 0.08;
}

:root.light-theme .step-card:hover {
    background: rgba(255, 255, 255, 0.9);
}

:root.light-theme .step-header h3 {
    color: #0f172a;
}

:root.light-theme .step-content p {
    color: #334155;
}

:root.light-theme .instructions-header h2 {
    color: #0f172a;
}

:root.light-theme .instructions-header p {
    color: #475569;
}

:root.light-theme .form-header h1 {
    color: #0f172a;
}

:root.light-theme .form-header p {
    color: #475569;
}

:root.light-theme .form-group label {
    color: #1e293b;
}

:root.light-theme .code-block {
    background: rgba(15, 23, 42, 0.05);
    border: 1px solid rgba(184, 169, 255, 0.2);
    color: var(--text-primary);
}

:root.light-theme .code-block code {
    color: #475569;
}

:root.light-theme .metric-card {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(184, 169, 255, 0.2);
}

:root.light-theme .metric-card:hover {
    background: rgba(255, 255, 255, 0.95);
}

:root.light-theme .theme-toggle {
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid rgba(184, 169, 255, 0.3);
}

:root.light-theme .theme-toggle:hover {
    background: rgba(255, 255, 255, 1);
}

/* Dodatkowe style dla formularzy w jasnym motywie */
:root.light-theme .form-group input {
    background: rgba(255, 255, 255, 0.8);
    border: 2px solid rgba(184, 169, 255, 0.2);
    color: var(--text-primary);
}

:root.light-theme .form-group input:focus {
    background: rgba(255, 255, 255, 0.95);
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(184, 169, 255, 0.1);
}

:root.light-theme .form-group input::placeholder {
    color: var(--text-muted);
}

:root.light-theme .help-text {
    color: var(--text-muted);
}

:root.light-theme .disclaimer-link {
    color: var(--text-secondary);
}

:root.light-theme .disclaimer-link:hover {
    color: var(--accent-color);
}

:root.light-theme .warning-note {
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.4);
    color: #b45309;
    font-weight: 500;
}

:root.light-theme .warning-note i {
    color: #b45309;
}

:root.light-theme .warning-note span {
    color: #92400e;
    font-weight: 600;
}

/* Footer w jasnym motywie */
:root.light-theme .footer {
    background: transparent;
    color: var(--text-muted);
}

:root.light-theme .disclaimer {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(184, 169, 255, 0.2);
    color: var(--text-muted);
}

/* Governor card w jasnym motywie - zachowanie oryginalnych kolorów */
:root.light-theme .governor-special-card {
    /* Zachowujemy oryginalne kolory kart gubernatora */
}

:root.light-theme .governor-active {
    /* Karta gubernatora zachowuje swój zielony gradient */
}

:root.light-theme .governor-candidate {
    /* Karta kandydata zachowuje swój pomarańczowy gradient */
}

:root.light-theme .governor-waiting {
    /* Karta waiting zachowuje swój szary gradient */
}

/* Raw data container w jasnym motywie */
:root.light-theme .raw-data-container {
    background: rgba(248, 250, 252, 0.8);
    border: 1px solid rgba(184, 169, 255, 0.2);
}

:root.light-theme .toggle-raw-data {
    background: var(--primary-gradient);
    color: white;
}

:root.light-theme .toggle-raw-data:hover {
    background: var(--secondary-gradient);
}

:root.light-theme .raw-data pre {
    background: rgba(15, 23, 42, 0.05);
    color: var(--text-primary);
    border: 1px solid rgba(184, 169, 255, 0.2);
}

/* Tekst w kartach na stronie results.html - jasny motyw */

:root.light-theme .metric-label {
    color: #374151;
    font-weight: 600;
}

:root.light-theme .metric-value {
    color: #111827;
    font-weight: 700;
}

/* Improve card content readability in light theme */
:root.light-theme .card-content {
    color: #374151;
}

:root.light-theme .card-header h3 {
    color: #111827;
    font-weight: 700;
}

:root.light-theme .node-info h2 {
    color: #111827;
    font-weight: 700;
}

:root.light-theme .timestamp {
    color: #6b7280;
    font-weight: 500;
}

:root.light-theme .header h1 {
    color: #0f172a;
}

:root.light-theme .subtitle {
    color: #475569;
}

:root.light-theme .footer {
    color: #64748b;
}

:root.light-theme .toggle-raw-data {
    color: white;
    font-weight: 500;
}

/* Header w jasnym motywie - połączony z informacjami o węźle */
:root.light-theme .header {
    background: linear-gradient(135deg, rgba(248, 250, 252, 0.9) 0%, rgba(226, 232, 240, 0.9) 100%);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(184, 169, 255, 0.2);
}

:root.light-theme .node-info {
    border-top: 1px solid rgba(184, 169, 255, 0.2);
}

/* Raw data tło w jasnym motywie */
:root.light-theme .raw-data {
    background: rgba(248, 250, 252, 0.9);
    border: 1px solid rgba(184, 169, 255, 0.2);
}

:root.light-theme .raw-data pre {
    background: rgba(255, 255, 255, 0.7);
    color: #1e293b;
    border: none;
}

/* ========== BASE STYLES ========== */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    min-height: 100vh;
    line-height: 1.6;
    transition: all 0.3s var(--animation-smooth);
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
    position: relative;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
}

/* ========== ENHANCED THEME TOGGLE ========== */
.theme-toggle-container {
    position: fixed;
    top: 25px;
    right: 25px;
    z-index: 1000;
}

.theme-toggle {
    position: relative;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: 2px solid var(--accent-color);
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    cursor: pointer;
    font-size: 1.5rem;
    transition: all 0.4s var(--animation-bounce);
    overflow: hidden;
    box-shadow: var(--shadow-primary);
}

.theme-toggle:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-primary), var(--glow-primary);
    border-color: var(--accent-secondary);
}

.theme-toggle i {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.4s var(--animation-smooth);
    color: var(--accent-color);
    filter: drop-shadow(var(--glow-primary));
}

/* Sun icon styling - pokazuje się w ciemnym motywie (przełączy na jasny) */
.theme-toggle .fa-sun {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(0deg) scale(1);
    color: #f59e0b;
}

/* Moon icon styling - ukryta w ciemnym motywie */
.theme-toggle .fa-moon {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(-180deg) scale(0.3);
    color: var(--accent-color);
}

/* Light theme state - zamiana ikon (pokazuje księżyc, bo przełączy na ciemny) */
:root.light-theme .theme-toggle .fa-sun {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(180deg) scale(0.3);
    color: #f59e0b;
}

:root.light-theme .theme-toggle .fa-moon {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(0deg) scale(1);
    color: var(--accent-color);
}

/* Enhanced pulse animation */
.theme-toggle.changing {
    animation: enhancedThemePulse 0.8s var(--animation-bounce);
}

@keyframes enhancedThemePulse {
    0% { transform: translateY(-5px) scale(1.1); }
    25% { transform: translateY(-8px) scale(1.2) rotate(5deg); }
    50% { transform: translateY(-10px) scale(1.25) rotate(-5deg); }
    75% { transform: translateY(-8px) scale(1.15) rotate(2deg); }
    100% { transform: translateY(-5px) scale(1.1) rotate(0deg); }
}

/* ========== ENHANCED MAIN CONTENT ========== */
.main-content {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: calc(100vh - 200px);
    padding: 60px 0;
    position: relative;
}

.form-container {
    max-width: 650px;
    width: 100%;
    background: var(--bg-card);
    backdrop-filter: blur(30px);
    border-radius: var(--radius-xl);
    padding: 50px;
    box-shadow: var(--shadow-primary);
    border: 1px solid rgba(184, 169, 255, 0.2);
    position: relative;
    animation: slideInUp 0.8s var(--animation-smooth);
}

/* Floating elements inside form */
.form-container::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: var(--primary-gradient);
    border-radius: var(--radius-xl);
    z-index: -1;
    opacity: 0.2;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-header {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
}

.form-header i {
    font-size: 4rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 20px;
    display: block;
    animation: iconFloat 3s ease-in-out infinite;
    will-change: transform;
}

.form-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 15px;
    letter-spacing: -0.5px;
}

.form-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
    font-weight: 400;
}

/* ========== ENHANCED FORM STYLES ========== */
.monitor-form {
    margin-bottom: 50px;
}

.form-group {
    margin-bottom: 30px;
    position: relative;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-secondary);
    font-size: 1rem;
    transition: all 0.3s var(--animation-smooth);
}

.form-group input {
    width: 100%;
    padding: 18px 20px;
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    color: var(--text-primary);
    font-size: 1.1rem;
    transition: all 0.3s var(--animation-smooth);
    position: relative;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: var(--glow-primary);
    background: rgba(184, 169, 255, 0.1) !important;
    transform: translateY(-2px);
}

/* SUPER AGGRESSIVE autofill fix - multiple approaches */

/* Normal input background */
.form-group input {
    background: var(--bg-glass) !important;
    background-color: var(--bg-glass) !important;
}

.form-group input:focus {
    background: rgba(184, 169, 255, 0.15) !important;
    background-color: rgba(184, 169, 255, 0.15) !important;
}

/* Method 1: Giant box-shadow trick */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px rgba(184, 169, 255, 0.15) inset !important;
    -webkit-text-fill-color: var(--text-primary) !important;
    caret-color: var(--accent-color) !important;
}

/* Method 2: Transition delay approach */
input:-webkit-autofill {
    -webkit-transition-delay: 99999s !important;
    -webkit-transition: color 99999s ease-out, background-color 99999s ease-out !important;
}

/* Method 3: More specific selectors */
.form-group input[name="node_ip"]:-webkit-autofill,
.form-group input[name="node_ip"]:-webkit-autofill:hover,
.form-group input[name="node_ip"]:-webkit-autofill:focus,
.form-group input[name="node_ip"]:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 50px rgba(184, 169, 255, 0.15) inset !important;
    -webkit-text-fill-color: var(--text-primary) !important;
    background-image: none !important;
    background-color: rgba(184, 169, 255, 0.15) !important;
    background: rgba(184, 169, 255, 0.15) !important;
    border-color: var(--accent-color) !important;
}

/* Method 4: Force background with pseudo elements */
.form-group input:-webkit-autofill::first-line {
    color: var(--text-primary) !important;
}

/* Firefox */
.form-group input:-moz-autofill {
    background: rgba(184, 169, 255, 0.15) !important;
    color: var(--text-primary) !important;
}

.form-group input::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

.help-text {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 8px;
    opacity: 0.8;
}

/* ========== ENHANCED SUBMIT BUTTON ========== */
.submit-btn {
    width: 100%;
    padding: 20px;
    border: none;
    border-radius: var(--radius-md);
    background: var(--primary-gradient) !important;
    background: var(--primary-gradient) !important;
    color: white !important;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.3s var(--animation-bounce);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-primary);
}

.submit-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;
}

.submit-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: var(--shadow-primary), var(--glow-primary);
}

.submit-btn:hover:not(:disabled)::before {
    left: 100%;
}

.submit-btn:active {
    transform: translateY(-1px);
}

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.submit-btn.loading span {
    opacity: 0;
}

.submit-btn .loading-spinner {
    position: absolute;
    opacity: 0;
    transition: opacity 0.3s var(--animation-smooth);
}

.submit-btn.loading .loading-spinner {
    opacity: 1;
}

/* ========== ENHANCED INSTRUCTIONS SECTION ========== */
.instructions-section {
    margin-top: 40px;
}

.instructions-header {
    text-align: center;
    margin-bottom: 40px;
}

.instructions-header i {
    font-size: 3rem;
    background: var(--secondary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 15px;
}

.instructions-header h2 {
    font-size: 2.2rem;
    font-weight: 700;
    background: var(--secondary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 15px;
    letter-spacing: -0.5px;
}

.instructions-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
    line-height: 1.6;
}

.instruction-steps {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.step-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    padding: 30px;
    border: 1px solid rgba(255, 181, 163, 0.15);
    transition: all 0.4s var(--animation-smooth);
    position: relative;
    overflow: hidden;
}

.step-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--secondary-gradient);
    transition: width 0.3s var(--animation-smooth);
}

.step-card:hover {
    box-shadow: var(--shadow-secondary);
    border-color: var(--accent-secondary);
}

.step-card:hover::before {
    width: 8px;
}

.step-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.step-header i {
    font-size: 1.8rem;
    color: var(--accent-secondary);
    filter: drop-shadow(var(--glow-secondary));
}

.step-header h3 {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-primary);
}

.step-content p {
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 15px;
}

.step-content p:last-child {
    margin-bottom: 0;
}

.step-content a {
    color: var(--accent-color);
    text-decoration: none;
    transition: all 0.3s var(--animation-smooth);
}

.step-content a:hover {
    color: var(--accent-secondary);
    text-shadow: var(--glow-secondary);
}

/* ========== ENHANCED CODE BLOCKS ========== */
.code-block {
    background: rgba(0, 0, 0, 0.6);
    border-radius: var(--radius-md);
    padding: 20px;
    margin: 15px 0;
    border-left: 4px solid var(--accent-color);
    position: relative;
    overflow: hidden;
}

.code-block::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 20px;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(184, 169, 255, 0.1));
}

.code-block code {
    color: var(--accent-color);
    font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
    font-size: 0.95rem;
    line-height: 1.6;
    display: block;
}

/* ========== ENHANCED WARNING NOTE ========== */
.warning-note {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 181, 163, 0.1);
    border: 1px solid var(--accent-secondary);
    border-radius: var(--radius-md);
    padding: 15px 20px;
    margin-top: 20px;
    animation: warningPulse 2s ease-in-out infinite alternate;
}

@keyframes warningPulse {
    0% { box-shadow: 0 0 0 rgba(255, 181, 163, 0.3); }
    100% { box-shadow: 0 0 20px rgba(255, 181, 163, 0.2); }
}

.warning-note i {
    color: var(--accent-secondary);
    font-size: 1.2rem;
    filter: drop-shadow(var(--glow-secondary));
}

.warning-note span {
    color: var(--text-primary);
    font-weight: 500;
}

/* ========== ENHANCED FOOTER ========== */
.footer {
    text-align: center;
    padding: 30px 0;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 60px;
    border-top: 1px solid rgba(184, 169, 255, 0.1);
}

.disclaimer {
    margin-top: 20px;
    padding: 15px;
    background: rgba(255, 181, 163, 0.05);
    border: 1px solid rgba(255, 181, 163, 0.2);
    border-radius: var(--radius-md);
    text-align: left;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    transition: all 0.3s var(--animation-smooth);
}

.disclaimer:target {
    background: rgba(255, 181, 163, 0.25) !important;
    border-color: var(--accent-secondary) !important;
    box-shadow: 0 0 25px rgba(255, 181, 163, 0.4) !important;
    animation: disclaimerHighlight 1.5s ease-out !important;
    will-change: transform, background, box-shadow;
    backface-visibility: hidden;
}

.disclaimer.highlight {
    background: rgba(255, 181, 163, 0.25) !important;
    border-color: var(--accent-secondary) !important;
    box-shadow: 0 0 25px rgba(255, 181, 163, 0.4) !important;
    animation: disclaimerHighlight 1.5s ease-out !important;
    will-change: transform, background, box-shadow;
    backface-visibility: hidden;
}

@keyframes disclaimerHighlight {
    0% {
        background: rgba(255, 181, 163, 0.4);
        transform: scale3d(1.03, 1.03, 1) translateZ(0);
        box-shadow: 0 0 30px rgba(255, 181, 163, 0.6);
    }
    100% {
        background: rgba(255, 181, 163, 0.05);
        transform: scale3d(1, 1, 1) translateZ(0);
        box-shadow: 0 0 5px rgba(255, 181, 163, 0.2);
    }
}

.disclaimer p {
    margin: 0;
    color: var(--text-muted);
    font-style: italic;
    line-height: 1.5;
}

.disclaimer-link {
    color: var(--accent-secondary);
    text-decoration: none;
    transition: all 0.3s var(--animation-smooth);
    border-bottom: 1px dotted var(--accent-secondary);
    cursor: pointer;
}

.disclaimer-link:hover {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
    text-shadow: 0 0 5px rgba(255, 181, 163, 0.3);
}

/* ========== HEADER ========== */
.header {
    background: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(75, 85, 99, 0.3);
    padding: 15px 0 20px 0;
    margin-bottom: 25px;
    border-radius: 0 0 20px 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo i {
    font-size: 2rem;
    color: var(--accent-color);
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #f8fafc;
}

.subtitle {
    color: #94a3b8;
    margin-top: 30px;
    font-size: 0.9rem;
}

.header-actions {
    display: flex;
    gap: 15px;
}

.refresh-btn, .back-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 0.9;
}

.refresh-btn {
    background: var(--primary-gradient);
    color: white;
}

.refresh-btn:hover {
    box-shadow: 0 4px 15px rgba(128, 15, 47, 0.3);
    opacity: 1;
    transform: translateY(-1px);
}

.back-btn {
    background: #374151;
    color: #e5e7eb;
    border: 2px solid #4b5563;
}

.back-btn:hover {
    background: #4b5563;
    transform: translateY(-1px);
    opacity: 1;
}

/* ========== NODE INFO IN HEADER ========== */
.node-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(75, 85, 99, 0.3);
}

.node-info h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #f8fafc;
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.node-info h2 i {
    color: var(--accent-color);
}

.node-icon {
    width: 1.8em;
    height: 1.8em;
    vertical-align: middle;
    margin-right: 0.5em;
    border-radius: 4px;
    object-fit: contain;
}

.timestamp {
    color: #94a3b8;
    font-size: 0.7rem;
    margin-bottom: 10px;
}

/* ========== METRICS GRID ========== */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.metric-card {
    background: rgba(31, 41, 55, 0.9);
    border-radius: 15px;
    padding: 25px;
    border: 1px solid rgba(75, 85, 99, 0.3);
    transition: all 0.3s ease;
    animation: fadeIn 0.6s ease-out;
}

.metric-card:hover {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    border-color: var(--accent-color);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(75, 85, 99, 0.3);
    background: none;
}

.card-header i {
    color: var(--accent-color);
    font-size: 1.4rem;
}

.card-header h3 {
    color: #f8fafc;
    font-size: 1.3rem;
    font-weight: 600;
}

.card-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
    color: #d1d5db;
}

.metric-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(75, 85, 99, 0.2);
}

.metric-item:last-child {
    border-bottom: none;
}

.metric-label {
    color: #9ca3af;
    font-weight: 500;
    flex: 1;
}

.metric-value {
    color: #e5e7eb !important;
    font-weight: 600;
    text-align: right;
    flex: 1;
    text-decoration: none !important;
}

/* Fix for mobile phone number auto-linking */
.metric-value a,
.metric-value a:link,
.metric-value a:visited,
.metric-value a:hover,
.metric-value a:active {
    color: inherit !important;
    text-decoration: none !important;
}

/* Specific fix for block numbers on mobile */
.metric-card .metric-value,
.metric-card .metric-value *,
.metric-card .metric-value a,
.metric-card .metric-value span {
    color: #e5e7eb !important;
    text-decoration: none !important;
    pointer-events: none !important;
    -webkit-touch-callout: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
}

/* Specific overrides for iOS Safari auto-linking */
.metric-value a[href^="tel:"] {
    color: #e5e7eb !important;
    text-decoration: none !important;
    pointer-events: none !important;
    cursor: default !important;
}

/* Light theme overrides */
:root.light-theme .metric-card .metric-value,
:root.light-theme .metric-card .metric-value *,
:root.light-theme .metric-card .metric-value a,
:root.light-theme .metric-value a[href^="tel:"] {
    color: #a3a3a5 !important;
    text-decoration: none !important;
}

/* Re-enable pointer events for buttons and actual links */
.metric-card button,
.metric-card a[href]:not([href^="tel:"]) {
    pointer-events: auto !important;
    -webkit-user-select: auto !important;
    user-select: auto !important;
}

.metric-card .metric-value.success,
.metric-value.success {
    color: #22c55e !important;
}

.metric-card .metric-value.warning,
.metric-value.warning {
    color: #f59e0b !important;
}

.metric-card .metric-value.error,
.metric-value.error {
    color: #ef4444 !important;
}

.metric-card .metric-value.info,
.metric-value.info {
    color: #3b82f6 !important;
}

/* Style statusów w jasnym motywie - z wyższym priorytetem */
:root.light-theme .metric-card .metric-value.success,
:root.light-theme .metric-value.success {
    color: #059669 !important;
}

:root.light-theme .metric-card .metric-value.warning,
:root.light-theme .metric-value.warning {
    color: #d97706 !important;
}

:root.light-theme .metric-card .metric-value.error,
:root.light-theme .metric-value.error {
    color: #dc2626 !important;
}

:root.light-theme .metric-card .metric-value.info,
:root.light-theme .metric-value.info {
    color: #2563eb !important;
}

:root.light-theme .sync-indicator.success {
    background: rgba(5, 150, 105, 0.1);
    border-color: rgba(5, 150, 105, 0.3);
}

:root.light-theme .sync-indicator.warning {
    background: rgba(217, 119, 6, 0.1);
    border-color: rgba(217, 119, 6, 0.3);
}

:root.light-theme .sync-indicator.error {
    background: rgba(220, 38, 38, 0.1);
    border-color: rgba(220, 38, 38, 0.3);
}

:root.light-theme .sync-indicator.info {
    background: rgba(37, 99, 235, 0.1);
    border-color: rgba(37, 99, 235, 0.3);
}

.sync-icon {
    margin-right: 5px;
}

/* ========== SPECIAL GOVERNOR CARD ========== */
.governor-special-card {
    position: relative;
    min-height: 180px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    animation: governorPulse 3s ease-in-out infinite;
}

.governor-special-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.governor-card-inner {
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    text-align: center;
    backdrop-filter: blur(10px);
}

/* Governor Active - Żywo Zielony */
.governor-active {
    background: linear-gradient(135deg, #00ff88 0%, #00cc6a 50%, #00994d 100%);
    border: 3px solid #00ff88;
}

.governor-active .governor-pulse {
    background: radial-gradient(circle, rgba(0, 255, 136, 0.3) 0%, transparent 70%);
    animation: governorActivePulse 2s ease-in-out infinite;
}

/* Governor Candidate - Pomarańczowy */
.governor-candidate {
    background: linear-gradient(135deg, #ff8c00 0%, #ff7700 50%, #e6550d 100%);
    border: 3px solid #ff8c00;
}

.governor-candidate .governor-pulse {
    background: radial-gradient(circle, rgba(255, 140, 0, 0.3) 0%, transparent 70%);
    animation: governorCandidatePulse 2s ease-in-out infinite;
}

/* Governor Waiting - Szary */
.governor-waiting {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 50%, #374151 100%);
    border: 3px solid #6b7280;
}

.governor-waiting .governor-pulse {
    background: radial-gradient(circle, rgba(107, 114, 128, 0.3) 0%, transparent 70%);
    animation: governorWaitingPulse 2s ease-in-out infinite;
}

.governor-icon-container {
    margin-bottom: 15px;
}

.governor-crown-icon {
    font-size: 4rem;
    color: #ffffff;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.5);
    animation: governorCrownFloat 4s ease-in-out infinite;
}

.governor-candidate-icon {
    font-size: 4rem;
    color: #ffffff;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.5);
    animation: governorCandidateWait 4s ease-in-out infinite;
}

.governor-waiting-icon {
    font-size: 4rem;
    color: #ffffff;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.5);
    animation: governorWaitingSync 2s linear infinite;
}

.governor-content {
    z-index: 2;
    position: relative;
}

.governor-status-badge {
    font-size: 2.4rem;
    font-weight: 900;
    margin-bottom: 8px;
    color: #ffffff;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    letter-spacing: 2px;
}

.governor-description {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}

.governor-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    transform: translate(-50%, -50%);
    border-radius: 20px;
    z-index: 1;
}

/* Animations */
@keyframes governorPulse {
    0%, 100% { 
        transform: scale(1);
        opacity: 1;
    }
    50% { 
        transform: scale(1.02);
        opacity: 0.95;
    }
}

@keyframes governorActivePulse {
    0%, 100% { 
        opacity: 0.3;
        transform: translate(-50%, -50%) scale(1);
    }
    50% { 
        opacity: 0.6;
        transform: translate(-50%, -50%) scale(1.1);
    }
}

@keyframes governorCandidatePulse {
    0%, 100% { 
        opacity: 0.3;
        transform: translate(-50%, -50%) scale(1);
    }
    50% { 
        opacity: 0.6;
        transform: translate(-50%, -50%) scale(1.1);
    }
}

@keyframes governorCrownFloat {
    0%, 100% { 
        transform: translateY(0px) rotate(0deg);
    }
    33% { 
        transform: translateY(-5px) rotate(2deg);
    }
    66% { 
        transform: translateY(5px) rotate(-2deg);
    }
}

@keyframes governorCandidateWait {
    0%, 45% { 
        transform: translateY(0px) rotate(0deg);
        opacity: 1;
    }
    50%, 95% { 
        transform: translateY(-2px) rotate(180deg);
        opacity: 0.9;
    }
    100% { 
        transform: translateY(0px) rotate(360deg);
        opacity: 1;
    }
}

@keyframes governorWaitingPulse {
    0%, 100% { 
        opacity: 0.2;
        transform: translate(-50%, -50%) scale(1);
    }
    50% { 
        opacity: 0.4;
        transform: translate(-50%, -50%) scale(1.05);
    }
}

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

/* ========== SPECIALIZED CARDS ========== */
.network-info {
    grid-column: span 2;
}

.signing-address .metric-value {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    word-break: break-all;
}

.certificate-info .metric-value {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    word-break: break-all;
}

/* ========== RAW DATA SECTION ========== */
.raw-data-container {
    margin: 40px 0;
    background: rgba(31, 41, 55, 0.5);
    border-radius: 15px;
    padding: 25px;
    border: 1px solid rgba(75, 85, 99, 0.3);
    text-align: center;
}

.toggle-raw-data {
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    opacity: 0.9;
}

.toggle-raw-data:hover {
    box-shadow: 0 4px 15px rgba(128, 15, 47, 0.3);
    opacity: 1;
    transform: translateY(-1px);
}

.raw-data {
    background: #111827;
    border: 1px solid #374151;
    border-radius: 8px;
    padding: 20px;
    margin-top: 15px;
    text-align: left;
}

.raw-data pre {
    color: #e5e7eb;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.4;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ========== ANIMATIONS ========== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Nieużywane animacje governor usunięte dla optymalizacji */

@keyframes iconFloat {
    0%, 100% {
        transform: translateZ(0) translateY(0px);
    }
    50% {
        transform: translateZ(0) translateY(-10px);
    }
}

/* ========== RESPONSIVE DESIGN ========== */
@media (max-width: 1024px) {
    .metrics-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
    
    .network-info {
        grid-column: span 1;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }

    .header-content {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    .logo h1 {
        font-size: 1.5rem;
    }

    .form-container {
        padding: 30px 20px;
    }
    
    .disclaimer {
        margin: 15px 10px 0 10px;
        padding: 12px;
        font-size: 0.85rem;
    }

    .metrics-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .node-info {
        margin-top: 12px;
        padding-top: 12px;
    }

    /* Responsywność dla karty Governor */
    .governor-special-card {
        min-height: 150px;
    }
    
    .governor-crown-icon,
    .governor-candidate-icon,
    .governor-waiting-icon {
        font-size: 2.5rem;
    }
    
    .governor-status-badge {
        font-size: 1.2rem;
        letter-spacing: 1px;
    }
    
    .governor-description {
        font-size: 0.9rem;
    }

    .metric-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .metric-label {
        font-size: 0.9rem;
    }

    .metric-value {
        font-size: 1rem;
        text-align: left;
        color: #e5e7eb !important;
        text-decoration: none !important;
    }

    .step-card {
        padding: 20px;
    }

    .step-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .code-block {
        font-size: 0.8rem;
        overflow-x: auto;
    }

    .theme-toggle-container {
        top: 20px;
        right: 20px;
    }
    
    .theme-toggle {
        width: 60px;
        height: 60px;
        font-size: 1.3rem;
    }

    .submit-btn {
        background: var(--primary-gradient) !important;
        color: white !important;
    }
}

@media (max-width: 480px) {
    .logo i {
        font-size: 2rem;
    }

    .logo h1 {
        font-size: 1.3rem;
    }

    .form-container {
        padding: 25px 15px;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .card-content {
        gap: 12px;
    }

    .step-header h3 {
        font-size: 1.1rem;
    }

    .code-block {
        padding: 12px;
        font-size: 0.75rem;
    }

    .theme-toggle {
        width: 55px;
        height: 55px;
        font-size: 1.2rem;
    }

    /* Bardzo małe ekrany - Governor card */
    .governor-special-card {
        min-height: 120px;
    }
    
    .governor-card-inner {
        padding: 20px 15px;
    }
    
    .governor-crown-icon,
    .governor-candidate-icon,
    .governor-waiting-icon {
        font-size: 2rem;
    }
    
    .governor-status-badge {
        font-size: 1rem;
        letter-spacing: 0.5px;
    }
    
    .governor-description {
        font-size: 0.8rem;
    }
}

/* ========== INDEX PAGE SPECIFIC STYLES ========== */
.step-card {
    background: rgba(31, 41, 55, 0.8);
    border: 1px solid rgba(75, 85, 99, 0.3);
}

.step-header h3 {
    color: #f8fafc;
}

.step-header i {
    color: #6366f1;
}

.step-content p {
    color: #d1d5db;
}

.code-block {
    background: #111827;
    border: 1px solid #374151;
}

.code-block code {
    color: #fbbf24;
}

.warning-note {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.warning-note i {
    color: #ef4444;
}

.warning-note span {
    color: #fecaca;
}

.instructions-header h2 {
    color: #f8fafc;
}

.instructions-header p {
    color: #94a3b8;
}

.instructions-header i {
    color: var(--accent-color);
}

.footer {
    color: #6b7280;
}

/* ========== RESULTS PAGE SPECIFIC STYLES ========== */

.node-info h2 {
    color: #f8fafc;
}

.node-info h2 i {
    color: var(--accent-color);
}

.timestamp {
    color: #94a3b8;
}

.metric-card {
    background: rgba(31, 41, 55, 0.9);
    border: 1px solid rgba(75, 85, 99, 0.3);
}

.metric-card:hover {
    border-color: var(--accent-color);
}

.card-header {
    border-bottom: 1px solid rgba(75, 85, 99, 0.3);
    background: none;
}

.card-header i {
    color: var(--accent-color);
}

.card-header h3 {
    color: #f8fafc;
}

.card-content {
    color: #d1d5db;
}

.metric-label {
    color: #9ca3af;
}

.metric-value {
    color: #e5e7eb !important;
    text-decoration: none !important;
}

.metric-item {
    border-bottom: 1px solid rgba(75, 85, 99, 0.2);
}

.sync-indicator.success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.sync-indicator.warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.sync-indicator.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.sync-indicator.info {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.sync-indicator.success i {
    color: #10b981;
}

.sync-indicator.warning i {
    color: #f59e0b;
}

.sync-indicator.error i {
    color: #ef4444;
}

.sync-indicator.info i {
    color: #3b82f6;
}

.sync-title {
    color: #f8fafc;
}

.sync-description {
    color: #94a3b8;
}

.sync-icon {
    margin-right: 5px;
}

.metric-value.success {
    color: #22c55e;
}

.metric-value.warning {
    color: #f59e0b;
}

.metric-value.error {
    color: #ef4444;
}

.metric-value.info {
    color: #3b82f6;
}

 