@import url('https://fonts.googleapis.com/css2?family=Stack+Sans+Notch:wght@200..700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Comfortaa:wght@300..700&display=swap');

body {
    box-sizing: border-box;
    margin: 0;
    min-height: 100%;
    padding: 2rem 1rem;
}

.home {
    background-color: #667eea;
    font-family: 'Comfortaa', sans-serif;
}

.byte_list_main {
  font-family: 'Stack Sans Notch', sans-serif;
}

body.byte-list {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100%; /* Ensures body covers full viewport height */
  background-repeat: no-repeat; /* Prevents repetition */
  background-attachment: fixed; /* Keeps gradient fixed during scroll */
  display: flex; /* Use flexbox for easy footer positioning */
  flex-direction: column; /* Stack header, main, and footer vertically */
  margin: 0; /* Remove default body margin */
  padding: 0; /* Remove default body padding */
} 

html {
    height: 100%;
    font-size: 16px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

nav {
  padding-top: 1rem;
}

nav ul {
    list-style-type: none;
    background-color: #FF534A;
    border: 4px solid #111111;
    border-radius: 10px;
    font-family: 'Comfortaa', sans-serif;
    font-weight: bold;
    padding: 16px;
}

nav ul li {
    display: inline;
    border-right: 2px solid #111111;
    padding-right: 8px;
    padding-left: 8px;
}

nav ul li:last-child {
    border-right: none;
}

nav ul li a {
    text-decoration: none;
    color: #000000;
}

nav ul li a:hover {
    text-decoration: underline;
}

nav ul li.selected {
    color: #404040;
}

#page-title {
    color: white;
    font-size: 2.5rem;
    margin: 0 0 0.5rem 0;
    font-weight: 700;
    text-align: center;
}

.subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.75rem;
    margin: 0;
    text-align: center;
}

.unit-abbr {
    font-family: 'Comfortaa', cursive;
}

.units-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.unit-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.unit-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.15);
}

.unit-card.selected {
    position: relative;
    background: #f8f9ff;
    border-radius: 12px;
    z-index: 0;
    overflow: hidden; /* keeps glow + border neatly inside the rounded corners */
}

.unit-card.selected::before {
    content: "";
    position: absolute;
    inset: 0;
    padding: 4px; /* border thickness */
    border-radius: 12px;
    background: linear-gradient(
        45deg,
        #ff4444,
        #ff8800,
        #ffdd00,
        #44ff44,
        #4488ff,
        #aa44ff,
        #ff4444
    );
    background-size: 400% 400%;
    animation: gradientBorder 6s ease infinite;
    filter: blur(3px); /* ✨ soft glow effect */
    -webkit-mask: linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    z-index: -1;
}

main {
    flex-grow: 1; /* Allows main content to expand and push footer down */
    padding: 20px;
    padding-bottom: 1rem;
}

@keyframes gradientBorder {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.unit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.unit-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a202c;
    margin: 0;
}

.unit-abbr {
    font-size: 1.25rem;
    font-weight: 600;
    color: #667eea;
    background: #e6e9ff;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
}

.unit-bytes {
    font-size: 0.875rem;
    color: #4a5568;
    margin: 0.5rem 0;
}

.unit-power {
    font-size: 1rem;
    color: #2d3748;
    font-weight: 600;
    margin: 0.5rem 0;
}

.comparison-section {
    background-color: white;
    border-radius: 12px;
    padding: 2rem;
    margin-top: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.comparison-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1a202c;
    margin: 0 0 1.5rem 0;
    text-align: center;
}

.comparison-grid {
    display: grid;
    gap: 1rem;
}

.comparison-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #f7fafc;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.comparison-label {
    font-weight: 600;
    color: #2d3748;
    font-size: 1rem;
}

.comparison-value {
    font-weight: 700;
    color: #667eea;
    font-size: 1.125rem;
}

.select-prompt {
    text-align: center;
    color: #718096;
    font-size: 1.125rem;
    padding: 2rem;
}

.expandable-number {
    cursor: pointer;
    color: #667eea;
    text-decoration: underline;
    text-decoration-style: dotted;
}

.expandable-number:hover {
    color: #5a67d8;
}

.expand-hint {
    font-size: 0.75rem;
    color: #718096;
    font-style: italic;
    margin-left: 0.25rem;
}

.expandable-number.expanded {
    word-break: break-all;
    line-height: 1.4;
}

footer {
    text-align: center;
    margin-top: 3rem;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.875rem;
    position: fixed;
    left: 0;
    bottom: 0;
    width: 100%;
    background-color: #eea166;
    font-family: 'Comfortaa', sans-serif;
    min-height: 100px; /* Example: set a minimum height */
    overflow: hidden; /* For containing floats */
}

footer.byte_list {
  font-family: 'Comfortaa', sans-serif;
}

@media (max-width: 768px) {
    h1 {
        font-size: 3rem;
    }

    .subtitle {
        font-size: 1rem;
        padding-bottom: 1rem;
    }

    .units-grid {
        grid-template-columns: 1fr;
    }
}