/* ============================================
   IL MIO IP - G Tech Group
   Main Stylesheet v3.2.0
   ============================================ */

/* --- CSS Variables --- */
:root {
    --primary-color: #5b91d5;
    --secondary-color: #254672;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --success-color: #28a745;
    --dark: #000222;
    --light: #f8f9fa;
    --border-radius: 12px;
    --box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    --box-shadow-hover: 0 8px 30px rgba(0,0,0,0.12);
    --bg-primary: #f8f9fa;
    --bg-card: #ffffff;
    --bg-card-hover: #ffffff;
    --text-primary: #1a1a1a;
    --text-secondary: #64748b;
    --text-muted: #666666;
    --border-color: #e5e7eb;
    --border-color-light: #f1f3f5;
}

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

body {
    font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--dark);
    line-height: 1.6;
    min-height: 100vh;
}

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

/* --- Header --- */
header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    height: 55px;
}

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

header img {
    height: 32px;
    width: auto;
}

header .site-title {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    line-height: 1;
}

header .menu-section {
    display: flex;
    align-items: center;
    gap: 20px;
}

header nav {
    display: flex;
    gap: 20px;
    align-items: center;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* --- Main Content --- */
main {
    padding-top: 25px;
    padding-bottom: 50px;
}

.main-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
    margin-top: 25px;
}

/* --- Cards --- */
article.card, .card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 25px;
    box-shadow: none;
    transition: box-shadow 0.2s ease;
}

article.card:hover, .card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

article.card h2, .card h2 {
    color: var(--text-primary);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 1.25rem;
}

article.card h2 svg, .card h2 svg {
    width: 24px;
    height: 24px;
    stroke-width: 2;
    color: var(--primary-color);
}

/* --- Info Rows --- */
.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color-light);
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.info-value {
    font-family: 'Courier New', Courier, monospace;
    color: var(--text-primary);
    text-align: right;
    word-break: break-all;
    font-weight: 500;
    font-size: 0.9rem;
    max-width: 60%;
}

/* --- Loading States --- */
.loading {
    color: #666;
    font-style: italic;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.skeleton-loader {
    display: inline-block;
    width: 280px;
    max-width: 80%;
}

.skeleton-bar {
    height: 2.5rem;
    border-radius: 8px;
    background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
}

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

/* --- Copy IP Button --- */
.copy-ip-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    padding: 8px 16px;
    background: transparent;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.copy-ip-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(91, 145, 213, 0.05);
}

.copy-ip-btn:active {
    transform: scale(0.97);
}

.copy-ip-btn .copy-feedback {
    display: none;
}

.copy-ip-btn.copied {
    border-color: var(--success-color);
    color: var(--success-color);
}

.copy-ip-btn.copied svg {
    display: none;
}

.copy-ip-btn.copied .copy-feedback {
    display: inline;
}

/* --- Blacklist Details --- */
.blacklist-details {
    display: block;
    margin-top: 6px;
}

.blacklist-names {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
}

.blacklist-link {
    color: var(--danger-color);
    text-decoration: underline;
    cursor: pointer;
    transition: color 0.2s;
}

.blacklist-link:hover {
    color: #a71d2a;
}

.blacklist-hint {
    display: block;
    margin-top: 4px;
    color: #767676;
    font-size: 0.75rem;
    font-style: italic;
}

/* --- IP Display --- */
.ip-display {
    background: var(--bg-card);
    text-align: center;
    padding: 50px 30px;
    border-radius: 10px;
    margin-bottom: 25px;
    border: 1px solid var(--border-color);
}

.ip-display h2 {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.95rem;
    margin-bottom: 15px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ip-address {
    font-size: 2.5rem;
    font-weight: 600;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, monospace;
    color: var(--text-primary);
    letter-spacing: 2px;
}

@media (max-width: 768px) {
    .ip-address {
        font-size: 2.2rem;
        letter-spacing: 1px;
    }
}

/* --- Buttons --- */
.action-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 50px;
    flex-wrap: wrap;
    animation: fadeInUp 0.8s ease-out 0.8s both;
}

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

.action-buttons-top {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 30px;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: white;
}

.btn:hover {
    opacity: 0.9;
}

.btn:active {
    opacity: 1;
    transform: scale(0.98);
}

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

.btn-whatsapp {
    background: #25d366;
}

.btn-ticket {
    background: var(--secondary-color);
}

.btn-secondary {
    background: #6c757d;
}

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--border-color);
    color: var(--text-secondary);
}

.btn-outline:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    opacity: 1;
}

.btn svg {
    width: 22px;
    height: 22px;
    position: relative;
    z-index: 1;
}

/* --- Status Indicators --- */
.status-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-left: 5px;
}

.status-ok {
    background-color: var(--secondary-color);
}

.status-warning {
    background-color: var(--warning-color);
}

.status-error {
    background-color: var(--danger-color);
}

/* --- User Agent Box --- */
.user-agent-box {
    background-color: var(--light);
    padding: 15px;
    border-radius: 5px;
    margin-top: 10px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    word-break: break-all;
    max-height: 100px;
    overflow-y: auto;
}

/* --- Footer --- */
.footer {
    text-align: center;
    margin-top: 60px;
    padding: 40px 20px;
    color: var(--text-secondary);
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
}

.footer strong {
    color: var(--dark);
    font-weight: 600;
}

.footer-links {
    margin-top: 20px;
    font-size: 0.95rem;
}

.footer-links a {
    color: var(--primary-color);
    text-decoration: none;
    margin: 0 15px;
    transition: all 0.3s;
    position: relative;
}

.footer-links a::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--secondary-color);
    transform: scaleX(0);
    transition: transform 0.3s;
}

.footer-links a:hover {
    color: var(--secondary-color);
}

.footer-links a:hover::after {
    transform: scaleX(1);
}

/* --- SEO Content --- */
.seo-content {
    margin-top: 35px;
    font-size: 0.9rem;
    color: var(--text-muted);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.8;
    padding: 0 20px;
}

.seo-content strong {
    color: var(--secondary-color);
}

/* --- Visually Hidden --- */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* --- Speed Test --- */
.speed-test-container {
    margin-top: 20px;
}

.speed-test-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.speed-test-item {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, #f5f7fa 0%, #e9ecef 100%);
    border-radius: 10px;
    transition: transform 0.3s;
}

.speed-test-item:hover {
    transform: translateY(-5px);
}

.speed-test-item h3 {
    font-size: 1rem;
    color: var(--secondary-color);
    margin-bottom: 10px;
    font-weight: 600;
}

.speed-value {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary-color);
    font-family: 'Courier New', Courier, monospace;
    line-height: 1;
}

.speed-unit {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 5px;
}

.speed-test-actions {
    text-align: center;
    margin: 30px 0;
}

.speed-test-progress {
    margin: 20px auto;
    max-width: 500px;
}

.progress-bar {
    height: 20px;
    background-color: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.speed-test-info {
    text-align: center;
    margin-top: 20px;
    color: var(--text-muted);
}

@media (max-width: 768px) {
    .speed-test-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .speed-value {
        font-size: 2rem;
    }
}

/* --- Accessibility --- */
*:focus {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

.skip-to-content {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--secondary-color);
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 0 0 4px 0;
    z-index: 1001;
}

.skip-to-content:focus {
    top: 0;
}

/* --- Loading Spinner --- */
.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

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

/* --- Modals --- */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: slideUp 0.3s ease-out;
    position: relative;
}

.modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 20px 20px 0 0;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

.modal-content h3 {
    color: var(--secondary-color);
    margin-bottom: 25px;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 600;
    font-size: 1.5rem;
}

.modal-content p {
    margin-bottom: 25px;
    color: #555;
    line-height: 1.6;
}

.modal-content .btn {
    min-width: 150px;
}

/* --- Privacy Notice --- */
.privacy-notice {
    background: #f8fafc;
    border-left: 3px solid var(--primary-color);
    padding: 18px 22px;
    margin: 25px 0;
    border-radius: 8px;
}

.privacy-notice h4 {
    color: var(--text-primary);
    margin-bottom: 10px;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 600;
    font-size: 1rem;
}

.privacy-notice p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* --- Map Section --- */
.map-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 25px;
    margin: 25px 0;
}

.map-section h2 {
    color: var(--text-primary);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-weight: 600;
    font-size: 1.25rem;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
}

.map-section h2 svg {
    width: 24px;
    height: 24px;
    stroke-width: 2;
    color: var(--primary-color);
}

#map {
    height: 400px;
    border-radius: 8px;
    background-color: var(--light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

@media (max-width: 768px) {
    #map {
        height: 350px;
    }
}

/* --- History Section --- */
.history-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 25px;
    margin: 25px 0;
}

.history-section h2 {
    color: var(--text-primary);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 1.25rem;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
}

.history-section h2 svg {
    width: 24px;
    height: 24px;
    stroke-width: 2;
    color: var(--primary-color);
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.history-table th {
    text-align: left;
    padding: 10px 12px;
    color: var(--text-secondary);
    font-weight: 600;
    border-bottom: 2px solid var(--border-color);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.history-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color-light);
    color: var(--text-primary);
}

.history-table tr:last-child td {
    border-bottom: none;
}

.history-table .changed {
    color: var(--primary-color);
    font-weight: 600;
}

.history-empty {
    text-align: center;
    padding: 30px;
    color: var(--text-secondary);
    font-style: italic;
}

.history-actions {
    margin-top: 15px;
    display: flex;
    justify-content: flex-end;
}

/* --- Dark Mode Toggle --- */
.dark-mode-toggle {
    background: none;
    border: 1.5px solid rgba(255,255,255,0.3);
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    color: white;
    font-size: 1.1rem;
    line-height: 1;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

.dark-mode-toggle:hover {
    border-color: rgba(255,255,255,0.6);
    background: rgba(255,255,255,0.1);
}

/* --- Dark Mode --- */
[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-card: #1e293b;
    --bg-card-hover: #273548;
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --border-color-light: #1e293b;
    --dark: #e2e8f0;
    --light: #1e293b;
}

[data-theme="dark"] .loading {
    color: #94a3b8;
}

[data-theme="dark"] .skeleton-bar {
    background: linear-gradient(90deg, #334155 25%, #475569 50%, #334155 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
}

[data-theme="dark"] .speed-test-item {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
}

[data-theme="dark"] .progress-bar {
    background-color: #334155;
}

[data-theme="dark"] .privacy-notice {
    background: #1e293b;
}

[data-theme="dark"] .modal-content {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

[data-theme="dark"] .modal-content p {
    color: #94a3b8;
}

[data-theme="dark"] .user-agent-box {
    background-color: #0f172a;
}

[data-theme="dark"] .blacklist-hint {
    color: #94a3b8;
}

[data-theme="dark"] .copy-ip-btn {
    border-color: #475569;
    color: #94a3b8;
}

[data-theme="dark"] .copy-ip-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(91, 145, 213, 0.1);
}

[data-theme="dark"] .btn-outline {
    border-color: #475569;
    color: #94a3b8;
}

[data-theme="dark"] .btn-outline:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* --- HTTP Headers Card --- */
.headers-list {
    max-height: 400px;
    overflow-y: auto;
}

.header-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color-light);
    gap: 12px;
}

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

.header-name {
    font-weight: 600;
    color: var(--primary-color);
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.85rem;
    white-space: nowrap;
    min-width: 140px;
}

.header-value {
    color: var(--text-primary);
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.85rem;
    word-break: break-all;
    text-align: right;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    header .container {
        height: 50px;
        padding: 0 15px;
    }

    header img {
        height: 28px;
    }

    header .site-title {
        font-size: 0.95rem;
    }

    header .menu-section {
        gap: 10px;
    }

    .container {
        padding: 15px;
    }

    .main-content {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .ip-display {
        padding: 35px 20px;
        border-radius: 15px;
    }

    .ip-address {
        font-size: 2rem;
        letter-spacing: 0.5px;
    }

    article.card, .card {
        padding: 20px;
    }

    article.card h2, .card h2 {
        font-size: 1.15rem;
    }

    .action-buttons, .action-buttons-top {
        flex-direction: column;
        gap: 15px;
    }

    .btn {
        width: 100%;
        justify-content: center;
        padding: 16px 24px;
        font-size: 1rem;
    }

    .info-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .info-value {
        text-align: left;
        max-width: 100%;
        font-size: 0.9rem;
    }

    .user-agent-box {
        font-size: 0.8rem;
    }

    .modal-content {
        margin: 20px;
        padding: 20px;
    }

    .header-item {
        flex-direction: column;
        gap: 4px;
    }

    .header-value {
        text-align: left;
    }

    .history-table {
        font-size: 0.8rem;
    }

    .history-table th,
    .history-table td {
        padding: 8px 6px;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.6rem;
    }

    .ip-address {
        font-size: 1.6rem;
    }

    article.card h2 svg, .card h2 svg {
        width: 20px;
        height: 20px;
    }
}

@media (min-width: 1200px) {
    .container {
        max-width: 1200px;
    }

    .main-content {
        grid-template-columns: repeat(3, 1fr);
        gap: 25px;
    }
}

/* --- Print Styles --- */
@media print {
    header,
    .skip-to-content,
    .action-buttons,
    .action-buttons-top,
    .btn,
    .copy-ip-btn,
    .speed-test-actions,
    .speed-test-progress,
    .privacy-notice,
    .footer,
    .modal,
    .cookie-banner,
    .cookie-preferences-overlay,
    #sw-update-notification,
    #pwa-install-banner,
    .dark-mode-toggle,
    .tooltip-icon,
    .tooltip-content,
    .history-actions,
    #start-speed-test {
        display: none !important;
    }

    body {
        background: white !important;
        color: #000 !important;
        font-size: 12pt;
        line-height: 1.4;
    }

    .container {
        max-width: 100%;
        padding: 0;
    }

    .ip-display {
        border: 2px solid #000;
        padding: 20px;
        margin-bottom: 15px;
        page-break-after: avoid;
    }

    .ip-address {
        color: #000 !important;
        font-size: 1.8rem;
    }

    article.card, .card {
        border: 1px solid #ccc;
        padding: 15px;
        margin-bottom: 10px;
        page-break-inside: avoid;
        box-shadow: none !important;
    }

    .main-content {
        display: block;
    }

    .main-content > * {
        margin-bottom: 15px;
    }

    .info-row {
        border-bottom: 1px solid #eee;
    }

    .info-value {
        color: #000 !important;
    }

    .map-section {
        page-break-inside: avoid;
    }

    #map {
        height: 250px;
    }

    .status-indicator {
        border: 1px solid currentColor;
    }

    a {
        color: #000 !important;
        text-decoration: underline;
    }

    a::after {
        display: none !important;
    }

    /* Print header */
    main::before {
        content: "Il Mio IP - Diagnostica Rete | G Tech Group";
        display: block;
        font-size: 16pt;
        font-weight: bold;
        text-align: center;
        margin-bottom: 10px;
        padding-bottom: 10px;
        border-bottom: 2px solid #254672;
        color: #254672;
    }

    main::after {
        content: "Generato da ilmioip.gtechgroup.it - G Tech Group S.R.L.S.";
        display: block;
        text-align: center;
        margin-top: 20px;
        padding-top: 10px;
        border-top: 1px solid #ccc;
        font-size: 9pt;
        color: #666;
    }
}

/* ============================================
   LANGUAGE SWITCHER
   ============================================ */
.lang-switcher {
    appearance: none;
    -webkit-appearance: none;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    padding: 4px 24px 4px 10px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    margin-right: 8px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='white' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 6px center;
    transition: all 0.2s;
}

.lang-switcher:hover {
    background-color: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
}

.lang-switcher:focus-visible {
    outline: 2px solid #5b91d5;
    outline-offset: 2px;
}

.lang-switcher option {
    background: #1e3c72;
    color: white;
}

/* ============================================
   TOOL CARDS (Port Scanner, Traceroute, SSL, VPN)
   ============================================ */
.tool-card {
    margin-top: 25px;
}

.tool-input-row {
    display: flex;
    gap: 10px;
    margin: 15px 0;
    align-items: center;
}

.tool-input {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid var(--border-color, #e5e7eb);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    background: var(--bg-card, #fff);
    color: var(--text-primary, #000222);
    transition: border-color 0.2s;
}

.tool-input:focus {
    outline: none;
    border-color: #5b91d5;
    box-shadow: 0 0 0 3px rgba(91, 145, 213, 0.15);
}

.btn-sm {
    padding: 10px 18px !important;
    font-size: 0.9rem !important;
    white-space: nowrap;
}

/* Results tables */
.results-table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
    font-size: 0.9rem;
}

.results-table th,
.results-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color, #e5e7eb);
}

.results-table th {
    background: var(--bg-primary, #f8f9fa);
    font-weight: 600;
    color: var(--text-primary, #254672);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.results-table tbody tr:hover {
    background: rgba(91, 145, 213, 0.05);
}

/* Traceroute time bars */
.time-bar-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.time-bar {
    height: 6px;
    border-radius: 3px;
    min-width: 4px;
    transition: width 0.3s;
}

/* SSL results */
.ssl-results {
    margin-top: 10px;
}

.ssl-status {
    font-size: 1.1rem;
    padding: 12px;
    border-radius: 8px;
    background: var(--bg-primary, #f8f9fa);
    margin-bottom: 12px;
}

/* VPN Compare */
.vpn-compare-instructions {
    padding: 12px;
    background: var(--bg-primary, #f8f9fa);
    border-radius: 8px;
    margin: 10px 0;
    font-size: 0.9rem;
    white-space: pre-line;
    line-height: 1.8;
}

.vpn-compare-actions {
    display: flex;
    gap: 10px;
    margin: 15px 0;
}

.vpn-compare-table .row-changed {
    background: rgba(243, 156, 18, 0.08);
}

.vpn-compare-table .row-changed td:last-child {
    font-weight: 600;
}

/* Loading inline */
.loading-inline {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    color: var(--text-secondary, #666);
    font-style: italic;
}

.loading-spinner-sm {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color, #e5e7eb);
    border-top-color: #5b91d5;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Status text helpers */
.success-text {
    color: #2ecc71;
    font-weight: 600;
    padding: 10px;
}

.error-text {
    color: #e74c3c;
    padding: 10px;
}

/* ============================================
   DARK MODE - Tool Cards Additions
   ============================================ */
[data-theme="dark"] .tool-input {
    background: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .tool-input::placeholder {
    color: var(--text-secondary);
}

[data-theme="dark"] .results-table th {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

[data-theme="dark"] .results-table tbody tr:hover {
    background: rgba(91, 145, 213, 0.1);
}

[data-theme="dark"] .ssl-status,
[data-theme="dark"] .vpn-compare-instructions {
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .lang-switcher {
    background-color: rgba(255, 255, 255, 0.1);
}

/* ============================================
   RESPONSIVE - Tool Cards
   ============================================ */
@media (max-width: 768px) {
    .tool-input-row {
        flex-direction: column;
    }

    .tool-input {
        width: 100%;
    }

    .vpn-compare-actions {
        flex-direction: column;
    }

    .results-table {
        font-size: 0.8rem;
    }

    .results-table th,
    .results-table td {
        padding: 6px 8px;
    }

    .lang-switcher {
        margin-right: 4px;
        padding: 3px 20px 3px 8px;
        font-size: 0.8rem;
    }
}
