/* This file contains the styles for the frontend application, ensuring an elegant and modern design. */

:root {
    --primary-color: #2d3748;
    --secondary-color: #4299e1;
    --gradient-color: #63b3ed;  /* Light blue color for gradients */
    --background-color: #f7fafc;
    --border-color: #e2e8f0;
    --subnet-color: #6b46c1;
    --danger-color: #e53e3e;
    --success-color: #38a169;
}

body {
    margin: 0;
    padding: 1.5rem;
    font-family: 'Inter', sans-serif; 
    background: radial-gradient(circle at top left, rgba(99, 179, 237, 0.1), var(--background-color) 70%);
    background-image: url('data:image/svg+xml;utf8,<svg width="60" height="60" xmlns="http://www.w3.org/2000/svg"><line x1="30" y1="26" x2="30" y2="34" stroke="%232d3748" stroke-width="0.2"/><line x1="26" y1="30" x2="34" y2="30" stroke="%232d3748" stroke-width="0.2"/></svg>');
    background-size: 40px 40px;
    color: var(--primary-color);
    font-size: 14px;
    line-height: 1.5;
    min-height: 100vh;
}

header {
    background: linear-gradient(120deg, var(--primary-color), #4a5568);
    color: white;
    padding: 1.5rem;
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-radius: 0;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0;
}

.header-content h1 {
    font-size: 1.5 rem;
    font-weight: 500;
    color: white;
    margin: 0;
    position: relative;
}

.header-content h1:after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 80px;
    height: 4px;
    /*background: linear-gradient(90deg, #ff6b6b, transparent); */
    border-radius: 2px;
}

h1 {
    margin: 0;
    font-size: 1.8rem;
}

.container {
    max-width: 1200px;
    margin: 100px auto 0 auto;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(226, 232, 240, 0.5);
    transition: all 0.4s ease-out;
}

.container:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

/* Add gradient border effect to container */
.container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 25%;
    background: 
        linear-gradient(90deg, #ff6b6b, #4ecdc4, #45b7d1, #96c93d),
        linear-gradient(180deg, #ff6b6b, #4ecdc4, #45b7d1, #96c93d);
    background-size: 100% 3px, 3px 100%;
    background-repeat: no-repeat;
    background-position: top, left;
    border-radius: inherit;
    clip-path: inset(0 0 -1px -1px);
    z-index: -1;
    pointer-events: none;
    animation: gradientShift 8s infinite ease-in-out;
}

@keyframes gradientShift {
    0% { background-position: 0% 0%, 0% 0%; }
    50% { background-position: 100% 0%, 0% 100%; }
    100% { background-position: 0% 0%, 0% 0%; }
}

.card {
    background: #ffffff;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    margin: 20px 0;
    padding: 20px;
}

.button {
    display: inline-block;
    font-size: 1em;
    color: #ffffff;
    background: #35424a;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.3s ease-out;
}

.button:hover {
    background: #2c3e50;
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.table th, .table td {
    padding: 10px;
    border: 1px solid #dddddd;
    text-align: left;
}

.table th {
    background: #35424a;
    color: #ffffff;
}

.table tr:nth-child(even) {
    background: #f2f2f2;
}

section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

h2 {
    color: var(--primary-color);
    margin-top: 0;
}

.error-message {
    background-color: #fee2e2;
    color: #e53e3e;
    padding: 1rem;
    border-radius: 0.375rem;
    margin: 1rem 0;
}

.jail-item {
    background: #f8f9fa;
    padding: 1rem;
    margin: 0.5rem 0;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

.jail-item button {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s ease-out;
}

.jail-item button:hover {
    background: #2980b9;
}

.ip-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.ip-table td {
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
}

.ip-cell {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem;
    border-radius: 6px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(226, 232, 240, 0.2));
    transition: all 0.4s ease-out;
    font-size: 0.875rem;
}

.ip-cell:hover {
    transform: translateY(-1px);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(66, 153, 225, 0.2));
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

.ip-cell.subnet {
    color: var(--subnet-color);
    background: linear-gradient(135deg, rgba(107, 70, 193, 0.1), rgba(255, 255, 255, 0.9));
}

.unban-button {
    opacity: 0;
    background: linear-gradient(45deg, var(--danger-color), #ff8787);
    border: none;
    color: white;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.3s ease-out;
}

.ip-cell:hover .unban-button {
    opacity: 1;
}

.unban-button:hover {
    background: linear-gradient(45deg, #c53030, var(--danger-color));
    transform: translateY(-1px);
}

.jails-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 1rem 0;
}

.jails-table td {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease-out;
}

.jail-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: 6px;
    background: linear-gradient(135deg, rgba(66, 153, 225, 0.05), rgba(255, 255, 255, 0.9));
    transition: all 0.4s ease-out;
}

.jail-cell:hover {
    transform: translateY(-1px);
    background: linear-gradient(135deg, rgba(66, 153, 225, 0.2), rgba(255, 255, 255, 0.9));
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

.jail-cell input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: 1rem;
    height: 1rem;
    border: 2px solid #cbd5e0;
    border-radius: 50%;
    outline: none;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.jail-cell input[type="radio"]:checked {
    border-color: #48bb78;
    background-color: #48bb78;
    box-shadow: 0 0 0 2px rgba(72, 187, 120, 0.2);
}

.jail-cell label {
    cursor: pointer;
    font-size: 1rem;
    color: #0a8292;
    font-weight: 400;
}

.jail-cell.active {
    background: linear-gradient(135deg, rgba(68, 236, 163, 0.3), rgba(255, 255, 255, 0.9));
    border-color: var(--secondary-color);
}

.banned-ips-header {
    margin-bottom: 1rem;
}

.logout-button {
    background: none; /* No background by default */
    color: white; /* Keep text visible */
    border: none; /* No border */
    padding: 0; /* Remove padding by default */
    border-radius: 0; /* Remove border-radius by default */
    cursor: pointer;
    font-size: 1.1rem; /* Fixed space in your original '1.5 rem' */
    font-weight: 400;
    transition: all 0.3s ease-out;
}

.logout-button:hover {
    background: linear-gradient(45deg, #069c7e, var(--secondary-color)); /* Gradient on hover */
    padding: 0.5rem 1rem; /* Add padding on hover */
    border-radius: 6px; /* Add border-radius on hover */
    transform: translateY(-1px); /* Lift effect */
}

.search-container {
    display: flex;
    align-items: center;
    gap: 10px; /* Space between elements */
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
    justify-content: flex-end; /* Align items to the right on larger screens */
}

.ip-search-input,
.ip-input {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    width: 100%; /* Make inputs full-width on mobile */
    max-width: 250px; /* Limit max width on larger screens */
}

.ip-input {
    width: 250px;
}

.ban-button {
    padding: 8px 16px;
    background-color: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    white-space: nowrap; /* Prevent text wrapping */
}

.ban-button:hover {
    background-color: #c82333;
}

/* Add media query for mobile responsiveness */
@media (max-width: 768px) {
    .search-container {
        flex-direction: column; /* Stack elements vertically on mobile */
        align-items: stretch; /* Stretch items to full width */
        justify-content: center; /* Center items vertically */
        gap: 8px; /* Reduce gap slightly for tighter spacing */
    }

    .ip-search-input,
    .ip-input {
        max-width: none; /* Remove max-width restriction on mobile */
        width: 100%; /* Full width on mobile */
    }

    .ban-button {
        width: 100%; /* Full width button on mobile */
        padding: 10px; /* Slightly larger padding for touch targets */
    }

    /* Optional: Adjust section padding for mobile */
    section {
        padding: 15px;
    }
}

.copyright-footer {
    position: fixed; /* Sticks to the bottom of the viewport */
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #f8f9fa; /* Light gray background for contrast */
    text-align: center;
    padding: 10px 0;
    font-size: 12px; /* Small, subtle text */
    color: #333; /* Dark gray text for readability */
    border-top: 1px solid #e7e7e7; /* Light border for separation */
    z-index: 1000; /* Ensures it stays on top of other content */
}

.copyright-footer p {
    margin: 0; /* Remove default paragraph margins */
    font-family: 'Inter', sans-serif; /* Matches your Inter font from index.html */
}