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

/* Custom styles for IPv6 Monitor */

:root {
    --primary-color: #3B82F6; /* Modern Blue */
    --secondary-color: #6B7280; /* Soft Gray */
    --success-color: #10B981; /* Vibrant Green */
    --danger-color: #EF4444; /* Alert Red */
    --info-color: #60A5FA; /* Sky Blue */
    --warning-color: #F59E0B; /* Amber */
    --light-bg: #F9FAFB; /* Very light gray for background */
    --card-bg: #FFFFFF; /* White for cards */
    --text-color: #374151; /* Darker text */
    --border-color: #E5E7EB; /* Light border */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --header-height: 150px;
    --card-min-height: 120px; /* Slightly increased for more breathing room */
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-color);
    background-color: var(--light-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
    padding-top: 1.5rem; /* Add some padding at the top */
    padding-bottom: 3rem; /* More padding at the bottom */
}

/* Header styles */
header {
    background-color: var(--primary-color);
    color: var(--light-bg);
    padding: 2rem 0;
    box-shadow: var(--shadow-md);
    min-height: var(--header-height);
    display: flex;
    align-items: center;
}

header h1 {
    color: var(--light-bg);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

header h1 a {
    color: inherit;
    text-decoration: none;
}

header p.lead {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.1rem;
}

.header-icon {
    margin-right: 0.75rem;
    width: 2rem;
    height: 2rem;
    display: inline-block;
    color: var(--light-bg);
}

/* Card styles */
.card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem; /* More rounded corners */
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease-in-out;
    min-height: var(--card-min-height);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 1.25rem; /* Increased padding */
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px); /* Subtle lift effect */
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-color);
    border-top-left-radius: 0.75rem;
    border-top-right-radius: 0.75rem;
    display: flex;
    align-items: center;
}

.card-title {
    font-size: 1.125rem; /* Slightly larger titles */
    color: var(--text-color);
    margin-bottom: 0.5rem;
    min-height: unset; /* Remove fixed height */
    display: flex;
    align-items: center;
    font-weight: 600;
}

.card-text {
    font-size: 2.25rem; /* Larger numbers for stats */
    font-weight: 700;
    margin-bottom: 0;
    min-height: unset; /* Remove fixed height */
    line-height: 1; /* Tighter line height */
}

.card-body {
    padding: 1.25rem;
}

/* Flag icon styles */
.flag-icon {
    width: 28px; /* Slightly larger */
    height: 28px;
    vertical-align: middle;
    border: 1px solid var(--border-color);
    border-radius: 0.25rem; /* Slightly rounded corners */
    box-shadow: var(--shadow-sm);
    margin-right: 0.75rem; /* More spacing */
    object-fit: cover;
}

/* Badge styles */
.badge {
    font-weight: 600;
    padding: 0.4em 0.8em;
    min-width: 3rem;
    display: inline-flex; /* Use flex for alignment */
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem; /* More rounded badges */
    font-size: 0.85em; /* Slightly smaller text */
}

.badge-success { background-color: var(--success-color); color: white; }
.badge-danger { background-color: var(--danger-color); color: white; }
.badge-info { background-color: var(--info-color); color: white; }
.badge-warning { background-color: var(--warning-color); color: white; }
.badge-secondary { background-color: var(--secondary-color); color: white; }


/* Button group styles */
.btn-group {
    box-shadow: var(--shadow-sm);
    border-radius: 0.5rem;
    overflow: hidden; /* Ensure rounded corners are visible */
    display: flex; /* Use flex for better control */
    flex-wrap: wrap;
    gap: 0; /* Remove gap, use border for separation */
}

.btn-group .btn {
    border-width: 0; /* Remove individual button borders */
    min-width: unset;
    padding: 0.75rem 1.25rem; /* More padding */
    font-weight: 500;
    transition: all 0.2s ease;
    border-right: 1px solid rgba(0,0,0,0.05); /* Subtle separator */
}

.btn-group .btn:last-child {
    border-right: none;
}

.btn-group .btn.active {
    background-color: var(--primary-color);
    color: white;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15); /* Inner shadow for active state */
}

.btn-group .btn:hover:not(.active) {
    background-color: var(--light-bg);
    color: var(--primary-color);
}

/* DataTables customization */
.dataTables_wrapper {
    padding: 1.5rem; /* Padding for the whole table wrapper */
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    box-shadow: var(--shadow-sm);
}

.dataTables_wrapper .dataTables_length select {
    padding: 0.5rem 1.75rem 0.5rem 0.75rem; /* Adjusted padding */
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    min-width: 5rem;
    background-position: right 0.75rem center; /* Adjust dropdown icon position */
    background-size: 0.6em 0.6em;
    background-repeat: no-repeat;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5L8 11L14 5'/%3e%3c/svg%3e");
}

.dataTables_wrapper .dataTables_filter {
    text-align: right; /* Align filter to the right */
    margin-bottom: 1rem;
}

.dataTables_wrapper .dataTables_filter label {
    font-weight: 500;
    color: var(--text-color);
}

.dataTables_wrapper .dataTables_filter input {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    min-width: 10rem; /* Increased width */
    margin-left: 0.5rem;
}

.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    padding-top: 1.5rem; /* Increased padding */
    min-height: unset;
}

/* Table styles */
.table {
    width: 100%;
    margin-bottom: 0;
    border-collapse: separate; /* Allow border-radius on cells */
    border-spacing: 0;
}

.table th,
.table td {
    padding: 0.9rem 1.25rem; /* More padding */
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    min-width: unset; /* Remove fixed width */
    white-space: nowrap;
    vertical-align: middle;
}

.table th {
    background-color: var(--light-bg);
    font-weight: 600;
    color: var(--text-color);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--border-color);
}

.table tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.03); /* Subtle hover effect */
}

/* First and last cell rounding */
.table th:first-child, .table td:first-child { border-left: 1px solid var(--border-color); }
.table th:last-child, .table td:last-child { border-right: 1px solid var(--border-color); }
.table thead tr:first-child th:first-child { border-top-left-radius: 0.75rem; }
.table thead tr:first-child th:last-child { border-top-right-radius: 0.75rem; }
.table tbody tr:last-child td:first-child { border-bottom-left-radius: 0.75rem; }
.table tbody tr:last-child td:last-child { border-bottom-right-radius: 0.75rem; }


/* Form styles */
.form-section .card-body {
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
}

.form-control {
    height: 2.75rem; /* Taller input fields */
    border-radius: 0.5rem; /* Rounded input fields */
    border: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
    font-size: 1rem;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.25); /* Primary color shadow */
}

.form-text {
    font-size: 0.875rem;
    color: var(--secondary-color);
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    border-radius: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background-color: #316DD3; /* Slightly darker primary on hover */
    border-color: #316DD3;
    box-shadow: var(--shadow-sm);
}

.btn-primary:focus {
    box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.5);
}

/* Alert styles */
.alert {
    border-radius: 0.75rem;
    box-shadow: var(--shadow-sm);
    min-height: unset;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    display: flex;
    align-items: center;
}

.alert .fas {
    margin-right: 0.75rem;
    font-size: 1.25rem;
}

/* Accessibility improvements */
.btn:focus,
.form-control:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (forced-colors: active) {
    .card,
    .btn-group,
    .input-group,
    .alert {
        border: 1px solid CanvasText;
    }
}

/* Responsive adjustments */
@media (max-width: 991px) { /* Adjust breakpoint for medium devices */
    .card-text {
        font-size: 1.75rem; /* Slightly smaller for tablets */
    }
}

@media (max-width: 767px) { /* Adjust breakpoint for small devices */
    header {
        padding: 1.5rem 0;
    }
    header h1 {
        font-size: 2.25rem;
    }
    header p.lead {
        font-size: 1rem;
    }
    .header-icon {
        width: 1.75rem;
        height: 1.75rem;
    }
    .card-text {
        font-size: 1.5rem; /* Smaller for phones */
    }
    .btn-group {
        flex-direction: column; /* Stack buttons on small screens */
        gap: 0.5rem;
    }
    .btn-group .btn {
        width: 100%;
        border-right: none; /* Remove separator when stacked */
        border-bottom: 1px solid rgba(0,0,0,0.05); /* Add bottom separator */
    }
    .btn-group .btn:last-child {
        border-bottom: none;
    }
    .dataTables_wrapper {
        padding: 1rem;
    }
    .dataTables_wrapper .dataTables_filter {
        text-align: left; /* Align filter to left on small screens */
    }
    .table th,
    .table td {
        padding: 0.75rem 1rem;
    }
}

/* Prevent layout shifts during font loading */
/* Keep existing @font-face rules if any, or remove if not needed.
   The Google Fonts import handles font loading. */

/* Add content-visibility for off-screen content - if it was here, keep it. */
/* .card:not(:hover) {
    content-visibility: auto;
    contain-intrinsic-size: 100px;
} */ 