/* Common styles for all pages */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #0a1420 0%, #1a2530 100%);
    color: #ffffff;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Grid background overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(0, 255, 238, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 238, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: -3;
    pointer-events: none;
    opacity: 0.5;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Orbitron', monospace;
    color: #00ffee;
    text-shadow: 0 0 10px rgba(0, 255, 238, 0.3);
}

/* Particles container */
#particles-js {
    position: fixed !important;
    width: 100% !important;
    height: 100% !important;
    top: 0 !important;
    left: 0 !important;
    z-index: -2 !important;
    pointer-events: none !important;
}

/* Content wrapper */
.content-wrapper {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    padding: 20px;
}

/* Back button */
.back-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    background: rgba(0, 255, 238, 0.2);
    color: #00ffee;
    padding: 12px 24px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 255, 238, 0.3);
    z-index: 1000;
    font-size: 14px;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 255, 238, 0.2);
}

.back-btn:hover {
    background: rgba(0, 255, 238, 0.3);
    transform: translateX(-5px) translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 255, 238, 0.4);
    border-color: #00ffee;
}

.back-btn:active {
    transform: translateX(-3px) translateY(0);
}

/* Loading animation */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 255, 238, 0.3);
    border-radius: 50%;
    border-top-color: #00ffee;
    animation: spin 1s ease-in-out infinite;
    margin-right: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Page title styling */
.page-title {
    text-align: center;
    font-size: 2.5rem;
    margin: 80px 0 40px 0;
    color: #00ffee;
    text-shadow: 0 0 20px rgba(0, 255, 238, 0.5);
}

/* Container styling */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Card styling */
.card {
    background: rgba(20, 30, 40, 0.8);
    border: 1px solid rgba(0, 255, 238, 0.2);
    border-radius: 15px;
    padding: 30px;
    margin: 20px 0;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.card:hover {
    border-color: rgba(0, 255, 238, 0.5);
    box-shadow: 0 10px 30px rgba(0, 255, 238, 0.2);
    transform: translateY(-5px);
}

/* Form styling */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #00ffee;
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid rgba(0, 255, 238, 0.3);
    border-radius: 8px;
    background: rgba(20, 30, 40, 0.8);
    color: #ffffff;
    font-size: 14px;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #00ffee;
    box-shadow: 0 0 10px rgba(0, 255, 238, 0.3);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* Button styling */
.btn {
    display: inline-block;
    padding: 12px 30px;
    background: linear-gradient(135deg, #00ffee, #00ccaa);
    color: #0a1420;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    box-shadow: 0 4px 15px rgba(0, 255, 238, 0.3);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 255, 238, 0.4);
}

.btn:active {
    transform: translateY(0);
}

/* Result styling */
.result-container {
    margin-top: 30px;
    padding: 20px;
    border-radius: 10px;
    display: none;
}

.result-safe {
    background: rgba(0, 255, 0, 0.1);
    border: 1px solid rgba(0, 255, 0, 0.3);
}

.result-warning {
    background: rgba(255, 255, 0, 0.1);
    border: 1px solid rgba(255, 255, 0, 0.3);
}

.result-danger {
    background: rgba(255, 0, 0, 0.1);
    border: 1px solid rgba(255, 0, 0, 0.3);
}

/* Унифициран анимиран фон за всички страници */
.animated-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: #0d0d0d;
}

.network-node {
    position: absolute;
    width: 3px;
    height: 3px;
    background: #00ffee;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(0, 255, 238, 0.6);
    animation: nodePulse 4s infinite ease-in-out;
}

.network-connection {
    position: absolute;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 238, 0.3), transparent);
    transform-origin: left center;
    animation: connectionFlow 10s infinite linear;
}

.floating-line {
    position: absolute;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 238, 0.2), transparent);
    transform-origin: left center;
    animation: floatingMove 15s infinite ease-in-out;
}

/* Поправени анимации за унифициран фон */
@keyframes nodePulse {
    0%, 100% { 
        opacity: 0.3; 
        transform: scale(0.8);
        box-shadow: 0 0 4px rgba(0, 255, 238, 0.3);
    }
    50% { 
        opacity: 0.8; 
        transform: scale(1.2);
        box-shadow: 0 0 12px rgba(0, 255, 238, 0.8);
    }
}

@keyframes connectionFlow {
    0% { 
        opacity: 0; 
        transform: scaleX(0);
    }
    25% { 
        opacity: 0.4; 
        transform: scaleX(1);
    }
    75% { 
        opacity: 0.4; 
        transform: scaleX(1);
    }
    100% { 
        opacity: 0; 
        transform: scaleX(0);
    }
}

@keyframes floatingMove {
    0% { 
        opacity: 0; 
        transform: translateX(-100px) translateY(-50px) rotate(0deg);
    }
    25% { 
        opacity: 0.3; 
        transform: translateX(50px) translateY(30px) rotate(45deg);
    }
    75% { 
        opacity: 0.3; 
        transform: translateX(150px) translateY(-30px) rotate(90deg);
    }
    100% { 
        opacity: 0; 
        transform: translateX(300px) translateY(50px) rotate(135deg);
    }
}

/* Responsive design */
@media (max-width: 768px) {
    .back-btn {
        top: 15px;
        left: 15px;
        padding: 10px 20px;
        font-size: 13px;
    }
    
    .page-title {
        font-size: 2rem;
        margin: 60px 0 30px 0;
    }
    
    .content-wrapper {
        padding: 15px;
    }
    
    .card {
        padding: 20px;
        margin: 15px 0;
    }
    
    .container {
        padding: 0 15px;
    }
}

@media (max-width: 480px) {
    .page-title {
        font-size: 1.8rem;
    }
    
    .btn {
        width: 100%;
        text-align: center;
    }
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(20, 30, 40, 0.5);
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 255, 238, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 255, 238, 0.5);
}

/* Selection styling */
::selection {
    background: rgba(0, 255, 238, 0.3);
    color: #ffffff;
}

/* Focus styling */
*:focus {
    outline: 2px solid rgba(0, 255, 238, 0.5);
    outline-offset: 2px;
}