:root {
    /* Light Mode Colors */
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary-color: #10b981;
    --background: #f8fafc;
    --background-alt: #ffffff;
    --surface: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --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);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-success: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

[data-theme="dark"] {
    --primary-color: #818cf8;
    --primary-dark: #6366f1;
    --primary-light: #a5b4fc;
    --secondary-color: #34d399;
    --background: #0f172a;
    --background-alt: #1e293b;
    --surface: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --border-color: #334155;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6), 0 10px 10px -5px rgba(0, 0, 0, 0.5);
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background: var(--background);
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    transition: background 0.3s ease, color 0.3s ease;
}

/* Site Header & Navigation */
.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 900;
    backdrop-filter: blur(10px);
}

.site-nav {
    max-width: 1400px; /* Increased from 1200px for wider layout */
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    font-weight: 700;
    font-size: 20px;
    color: var(--text-primary);
    transition: transform 0.3s ease;
    flex-shrink: 0; /* Prevent logo from shrinking */
}

.nav-logo:hover {
    transform: scale(1.05);
}

.logo-icon {
    font-size: 28px;
    line-height: 1;
}

.logo-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 4px; /* Reduced from 8px for tighter spacing */
    flex-grow: 1; /* Allow nav links to grow and center */
    justify-content: center; /* Center the navigation links */
    flex-wrap: nowrap; /* Prevent wrapping on desktop */
}

.nav-link {
    padding: 10px 16px; /* Reduced horizontal padding from 20px to 16px */
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 15px;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
    white-space: nowrap; /* Prevent text wrapping */
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--background);
}

.nav-link.active {
    color: var(--primary-color);
    background: var(--background);
    font-weight: 600;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 6px;
    left: 16px; /* Updated from 20px to match new padding */
    right: 16px; /* Updated from 20px to match new padding */
    height: 2px;
    background: var(--gradient-primary);
    border-radius: 2px;
}

.container {
    flex: 1;
    padding: 2rem 1rem;
    margin: 0 auto;
    max-width: 1200px;
    width: 100%;
}

/* Dark Mode Toggle - Now Integrated in Header */
.theme-toggle {
    position: relative; /* Changed from fixed to integrate into header */
    top: auto;
    right: auto;
    z-index: auto;
    background: var(--surface);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    width: 44px; /* Slightly smaller to fit in header */
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    font-size: 22px;
    flex-shrink: 0; /* Prevent shrinking */
}

.theme-toggle:hover {
    transform: scale(1.1) rotate(15deg);
    box-shadow: var(--shadow-lg);
}

.title {
    text-align: center;
    color: var(--text-primary);
    margin-bottom: 2rem;
    font-weight: 700;
}

.form-wrapper {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 32px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.form-wrapper:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-2px);
}

.ui.form .field {
    width: 100%;       /* Ensures the field takes full width of its container */
}

textarea {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 16px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    resize: vertical;
    font-family: inherit;
    font-size: 15px;
    background: var(--surface);
    color: var(--text-primary);
    transition: all 0.3s ease;
    line-height: 1.6;
}

textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.generate-button {
    width: 50%;
    margin-top: 1.5rem;
    padding: 14px 32px;
    background: var(--gradient-primary) !important;
    color: white !important;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
    text-transform: none;
}

.generate-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.generate-button:active {
    transform: translateY(0);
}

.result {
    margin-top: 2rem;
    width: 100%;
}

.hash-result {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100px
}

.ui.table {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.ui.table thead th {
    background: var(--gradient-primary);
    color: white;
    padding: 16px;
    font-weight: 600;
    text-align: left;
    border: none;
}

.ui.table td {
    vertical-align: middle;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.ui.table tbody tr:last-child td {
    border-bottom: none;
}

.ui.table tbody tr {
    transition: background 0.2s ease;
}

.ui.table tbody tr:hover {
    background: var(--background);
}

.copy-button {
    background: var(--primary-color) !important;
    color: white !important;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.copy-button:hover {
    background: var(--primary-dark) !important;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.copy-button:active {
    transform: translateY(0);
}

.info-section {
    margin-top: 3rem;
    padding: 32px;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

.info-section:hover {
    box-shadow: var(--shadow-lg);
}

.info-section h2 {
    color: var(--text-primary);
    font-weight: 700;
    font-size: 28px;
    margin-bottom: 20px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.info-section h3 {
    color: var(--text-primary);
    font-weight: 600;
    margin-top: 24px;
    margin-bottom: 12px;
}

.info-section p {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 16px;
}

.info-section ul {
    color: var(--text-secondary);
    line-height: 1.8;
    padding-left: 24px;
}

.info-section ul li {
    margin-bottom: 8px;
}

footer {
    margin-top: auto;
    padding: 32px 0;
    background: var(--surface);
    border-top: 1px solid var(--border-color);
}

.copyright {
    margin-top: 10px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
}

.responsive-image {
    width: 100%;   /* Makes the image as wide as its container */
    height: auto;  /* Maintains aspect ratio */
    max-width: 600px; /* Set a max-width if you want to limit how large the image can be */
    display: block;  /* Removes any default spacing around the image */
    margin: 0 auto;  /* Center the image if container is wider */
}

.logo-container {
    text-align: center;  /* If you want the container to be centered */
    margin-bottom: 20px; /* Adds some space below the logo */
}

.logo-link {
    display: block;
    text-decoration: none;
    color: #333; /* Adjust color as needed */
    font-size: 18px;
    margin-top: 5px;
}

.logo-link:hover {
    text-decoration: underline;
}

/* Mode Switcher */
.mode-switcher {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 24px;
    padding: 6px;
    background: var(--background);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.mode-btn {
    padding: 12px 28px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s ease;
    position: relative;
}

.mode-btn:hover {
    color: var(--text-primary);
    background: var(--surface);
}

.mode-btn.active {
    background: var(--primary-color);
    color: white;
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

/* File Upload Styles */
.file-upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 16px;
    padding: 40px;
    text-align: center;
    background: var(--background);
    transition: all 0.3s ease;
    cursor: pointer;
}

.file-upload-area:hover {
    border-color: var(--primary-color);
    background: var(--surface);
    transform: scale(1.02);
}

.file-upload-area input[type="file"] {
    display: block;
    margin: 20px auto;
    padding: 12px;
    cursor: pointer;
    font-family: inherit;
    color: var(--text-primary);
}

.file-upload-area p {
    color: var(--text-secondary);
    margin: 8px 0;
}

.file-upload-icon {
    font-size: 56px;
    color: var(--primary-color);
    margin-bottom: 16px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

/* Notification Styles */
.notification {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gradient-success);
    color: white;
    border-radius: 12px;
    padding: 16px 32px;
    box-shadow: var(--shadow-xl);
    z-index: 1000;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    font-weight: 600;
    font-size: 15px;
    backdrop-filter: blur(10px);
}

.notification.show {
    bottom: 32px;
    opacity: 1;
}

.notification-error {
    background: var(--gradient-secondary);
}

.notification-success {
    background: var(--gradient-success);
}

/* Loading Styles */
.loading {
    text-align: center;
    padding: 40px;
    font-size: 18px;
    color: var(--primary-color);
    font-weight: 600;
    position: relative;
}

.loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

.loading::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--primary-light);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 12px;
    vertical-align: middle;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Error Message */
.error-message {
    background: linear-gradient(135deg, #fee 0%, #fdd 100%);
    border: 2px solid #fcc;
    color: #c33;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    margin: 20px 0;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

/* Source Info */
.source-info {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-weight: 600;
    color: #1976d2;
    border: 1px solid #90caf9;
    box-shadow: var(--shadow-sm);
}

/* Algorithm Comparison Table */
.comparison-table {
    margin: 30px 0;
    overflow-x: auto;
    border-radius: 16px;
}

.comparison-table table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--surface);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.comparison-table th {
    background: var(--gradient-primary);
    color: white;
    padding: 16px;
    text-align: left;
    font-weight: 600;
    font-size: 15px;
}

.comparison-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 14px;
}

.comparison-table tbody tr:last-child td {
    border-bottom: none;
}

.comparison-table tbody tr {
    transition: all 0.2s ease;
}

.comparison-table tbody tr:hover {
    background: var(--background);
    transform: scale(1.01);
}

/* Responsive Design */

/* Large Desktop - Extra space for nav */
@media (max-width: 1200px) {
    .nav-link {
        padding: 10px 12px; /* Further reduce padding */
        font-size: 14px;
    }

    .nav-link.active::after {
        left: 12px;
        right: 12px;
    }
}

/* Tablet - Compact nav */
@media (max-width: 1024px) {
    .site-nav {
        gap: 12px;
    }

    .nav-link {
        padding: 8px 10px;
        font-size: 13px;
    }

    .nav-link.active::after {
        left: 10px;
        right: 10px;
    }
}

/* Mobile - Stacked layout */
@media (max-width: 768px) {
    .site-nav {
        flex-wrap: wrap;
        padding: 12px 16px;
        gap: 12px;
    }

    .nav-logo {
        font-size: 18px;
        order: 1; /* Logo first */
    }

    .logo-icon {
        font-size: 24px;
    }

    .theme-toggle {
        order: 2; /* Toggle second (top right) */
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    .nav-links {
        order: 3; /* Nav links last (full width below) */
        width: 100%;
        justify-content: center;
        gap: 6px;
        flex-wrap: wrap; /* Allow wrapping on mobile */
    }

    .nav-link {
        padding: 8px 12px;
        font-size: 13px;
    }

    .nav-link.active::after {
        left: 12px;
        right: 12px;
    }

    .container {
        padding: 1rem;
    }

    .logo-container {
        margin-bottom: 20px;
    }

    .form-wrapper {
        padding: 20px;
    }

    .generate-button {
        width: 100%;
        font-size: 15px;
    }

    .mode-switcher {
        flex-direction: row;
        gap: 8px;
    }

    .mode-btn {
        flex: 1;
        padding: 10px 16px;
        font-size: 14px;
    }

    .hash-result {
        max-width: 150px;
        font-size: 13px;
    }

    .info-section {
        padding: 20px;
    }

    .info-section h2 {
        font-size: 24px;
    }

    .comparison-table {
        font-size: 13px;
    }

    .comparison-table td,
    .comparison-table th {
        padding: 12px 8px;
    }
}

/* Feature Cards */
.feature-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin: 30px 0;
}

.feature-card {
    background: var(--surface);
    padding: 28px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.feature-card:hover::before {
    transform: scaleX(1);
}

.feature-card h3 {
    color: var(--text-primary);
    margin-top: 0;
    margin-bottom: 12px;
    font-weight: 600;
    font-size: 20px;
}

.feature-card p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin: 0;
    font-size: 15px;
}

/* Security Badge */
.security-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: var(--shadow-sm);
}

.security-badge.high {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
}

.security-badge.medium {
    background: linear-gradient(135deg, #FF9800 0%, #f57c00 100%);
    color: white;
}

.security-badge.low {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
    color: white;
}

.security-badge.deprecated {
    background: linear-gradient(135deg, #9E9E9E 0%, #757575 100%);
    color: white;
}

/* Logo Container */
.logo-container {
    text-align: center;
    margin-bottom: 32px;
}

/* Smooth Scroll */
html {
    scroll-behavior: smooth;
}

/* Selection Color */
::selection {
    background: var(--primary-light);
    color: white;
}

::-moz-selection {
    background: var(--primary-light);
    color: white;
}

/* Input Labels */
label {
    color: var(--text-primary);
    font-weight: 500;
}

/* Radio Buttons */
input[type="radio"] {
    cursor: pointer;
    accent-color: var(--primary-color);
    margin: 0 8px;
}