:root {
    --bg-dark: #0f172a;
    --bg-darker: #020617;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --accent: #0ea5e9;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --card-bg: rgba(15, 23, 42, 0.6);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-darker);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
    padding: 2rem 1rem;
}

/* Dynamic Background */
.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at 15% 50%, rgba(14, 165, 233, 0.15), transparent 25%),
                radial-gradient(circle at 85% 30%, rgba(59, 130, 246, 0.15), transparent 25%);
    z-index: -1;
    animation: pulseBg 15s ease-in-out infinite alternate;
}

@keyframes pulseBg {
    0% { transform: scale(1); }
    100% { transform: scale(1.1); }
}

.container {
    width: 100%;
    max-width: 800px;
    z-index: 1;
}

header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.logo-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: float 3s ease-in-out infinite;
    display: inline-block;
}

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

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #38bdf8, #818cf8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: var(--glass-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.image-container {
    width: 100%;
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
}

.hero-image {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
}

.input-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (max-width: 600px) {
    .input-group {
        grid-template-columns: 1fr;
    }
}

.input-field {
    position: relative;
    width: 100%;
}

.input-field.full-width {
    grid-column: 1 / -1;
}

.input-field input, .input-field select {
    width: 100%;
    padding: 1.5rem 1rem 0.6rem;
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
    appearance: none;
    -webkit-appearance: none;
}

.input-field input:focus, .input-field input:not(:placeholder-shown),
.input-field select:focus, .input-field select.has-value {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.2);
}

.input-field label {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.input-field input:focus ~ label,
.input-field input:not(:placeholder-shown) ~ label,
.input-field select:focus ~ label,
.input-field select.has-value ~ label {
    top: 0.75rem;
    font-size: 0.75rem;
    color: var(--accent);
}

.tooltip {
    position: absolute;
    right: 1rem;
    top: 40%;
    transform: translateY(-50%);
    cursor: help;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.tooltip:hover {
    opacity: 1;
}

.btn-primary {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.6);
}

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

.btn-icon, .btn-secondary svg {
    transition: transform 0.3s ease;
}

.btn-primary:hover .btn-icon {
    transform: translateX(4px);
}

.btn-secondary {
    width: 100%;
    margin-top: 1.5rem;
    padding: 0.8rem;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent);
    transform: translateY(-2px);
}

.btn-secondary:hover svg {
    transform: translateY(2px);
}

.hidden {
    display: none !important;
}

.results-container {
    margin-top: 2.5rem;
    padding-top: 2.5rem;
    border-top: 1px solid var(--glass-border);
    animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.results-container h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.result-card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: transform 0.3s ease;
}

.result-card:hover {
    transform: translateY(-5px);
    background: rgba(30, 41, 59, 0.8);
}

.icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.bg-blue { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
.bg-purple { background: rgba(168, 85, 247, 0.2); color: #c084fc; }
.bg-teal { background: rgba(20, 184, 166, 0.2); color: #2dd4bf; }
.bg-yellow { background: rgba(234, 179, 8, 0.2); color: #facc15; }

.result-label {
    display: block;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.result-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
}

.cabos-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-top: 0.5rem;
}

.cabo-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(15, 23, 42, 0.3);
    padding: 0.5rem 0.8rem;
    border-radius: 8px;
    border-left: 2px solid var(--accent);
}

.cabo-tensao {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.cabo-bitola {
    color: var(--text-main);
    font-weight: 700;
    font-size: 1.1rem;
}

.details-text {
    background: rgba(15, 23, 42, 0.4);
    padding: 1rem;
    border-radius: 12px;
    font-size: 0.9rem;
    color: var(--text-muted);
    border-left: 4px solid var(--accent);
}

.details-text p {
    margin-bottom: 0.5rem;
}

.details-text p:last-child {
    margin-bottom: 0;
}

/* =========================================
   Sidebar / Menu Lateral
   ========================================= */
.menu-toggle {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
    background: var(--glass-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.menu-toggle:hover {
    transform: scale(1.05);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(2, 6, 23, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

.sidebar {
    position: fixed;
    top: 0;
    left: -320px;
    width: 300px;
    height: 100vh;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--glass-border);
    z-index: 1002;
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.5);
    transition: left 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

.sidebar.open {
    left: 0;
}

.sidebar-header {
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
}

.sidebar-header h3 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
    margin: 0;
}

.btn-close-menu {
    background: transparent;
    border: none;
    font-size: 2.5rem;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s, transform 0.2s;
}

.btn-close-menu:hover {
    color: #ef4444;
    transform: scale(1.1);
}

.sidebar-nav {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.nav-link {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    font-weight: 600;
    padding: 0.8rem 1.2rem;
    border-radius: 12px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid transparent;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
    color: var(--accent);
}

.nav-link.active {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.3);
}

.results-footer {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.results-footer .btn-secondary {
    flex: 1;
    margin-top: 0;
    text-decoration: none;
}

@media (max-width: 600px) {
    .results-footer {
        flex-direction: column;
    }
}

.main-footer {
    padding: 2.5rem 1.5rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--glass-border);
    margin-top: 4rem;
    line-height: 1.6;
}

.main-footer p {
    margin-bottom: 0.5rem;
}

.main-footer a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.main-footer a:hover {
    color: var(--primary);
    text-decoration: underline;
}
