/* Font face definition */
@font-face {
    font-family: 'Bungee Inline';
    src: url('fonts/BungeeInline-Regular.woff2') format('woff2'),
         url('fonts/BungeeInline-Regular.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

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

:root {
    /* Light theme - warm beige with maximum contrast */
    --bg-color: #fffbf7;      /* very light warm beige */
    --text-color: #000000;     /* pure black for maximum contrast */
    --border-color: #000000;   /* black borders for maximum contrast */
    --input-bg: #f8f4f0;      /* slightly darker beige */
    --input-focus-bg: #f0ebe6; /* focused input bg */
    --button-bg: #f8f4f0;     /* button background */
    --button-hover-bg: #000000; /* black hover */
    --button-hover-text: #fffbf7; /* light text on hover */
    --error-bg: #f8f4f0;      /* error background */
    --shadow-color: #000000;   /* shadow color */
}

[data-theme="dark"] {
    /* Dark theme - dark blue-gray with maximum contrast */
    --bg-color: #0a0e14;      /* very dark blue-gray */
    --text-color: #ffffff;     /* pure white for maximum contrast */
    --border-color: #ffffff;   /* white borders for maximum contrast */
    --input-bg: #1a202c;      /* dark blue */
    --input-focus-bg: #2d3748; /* focused input bg */
    --button-bg: #1a202c;     /* button background */
    --button-hover-bg: #ffffff; /* white hover */
    --button-hover-text: #0a0e14; /* very dark text on hover */
    --error-bg: #1a202c;      /* error background */
    --shadow-color: #ffffff;   /* shadow color */
}

html, body {
    height: 100%;
}

body {
    font-family: 'Courier New', monospace;
    line-height: 1.4;
    color: var(--text-color);
    background: var(--bg-color);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Theme toggle */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border: 2px solid var(--border-color);
    background: var(--button-bg);
    color: var(--text-color);
    cursor: pointer;
    font-family: 'Courier New', monospace;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 1000;
}

.theme-toggle:hover {
    background: var(--button-hover-bg);
    color: var(--button-hover-text);
    transform: translate(-1px, -1px);
    box-shadow: 2px 2px 0 var(--shadow-color);
}

.theme-toggle:active {
    transform: translate(0, 0);
    box-shadow: 1px 1px 0 var(--shadow-color);
}

/* Container */
.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

/* Main content */
.main {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
    max-width: 800px;
    width: 100%;
    text-align: center;
    padding: 0 20px;
}

/* Typography */
.title {
    font-family: 'Bungee Inline', 'Courier New', monospace;
    font-size: 3rem;
    font-weight: normal;
    margin-bottom: 8px;
    border: none;
    padding: 16px 24px;
    background: transparent;
    color: var(--text-color);
    letter-spacing: -0.02em;
    transition: all 0.3s ease;
}

.subtitle {
    font-size: 1.25rem;
    margin-bottom: 4px;
    opacity: 0.8;
}

.subtitle a {
    color: var(--text-color);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

.subtitle a:hover {
    text-decoration-thickness: 2px;
}

.description {
    font-size: 1rem;
    opacity: 0.7;
    margin-bottom: 8px;
}

.description small {
    font-size: 0.875rem;
    opacity: 0.6;
    display: block;
    margin-top: 4px;
}

/* Input container */
.input-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

/* Input styling */
.url-input {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    font-family: 'Courier New', monospace;
    border: 2px solid var(--border-color);
    background: var(--input-bg);
    color: var(--text-color);
    outline: none;
    transition: all 0.3s ease;
}

.url-input:focus {
    background: var(--input-focus-bg);
    border-color: var(--border-color);
    box-shadow: inset 2px 2px 0 var(--shadow-color);
}

.url-input::placeholder {
    color: var(--text-color);
    opacity: 0.6;
}

.url-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--input-focus-bg);
}

/* Button styling */
.forward-button {
    padding: 12px 24px;
    font-size: 16px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    background: var(--button-bg);
    color: var(--text-color);
    border: 2px solid var(--border-color);
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.forward-button:hover:not(:disabled) {
    background: var(--button-hover-bg);
    color: var(--button-hover-text);
    transform: translate(-1px, -1px);
    box-shadow: 2px 2px 0 var(--shadow-color);
}

.forward-button:active:not(:disabled) {
    transform: translate(0, 0);
    box-shadow: 1px 1px 0 var(--shadow-color);
}

.forward-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--input-focus-bg);
    color: var(--text-color);
}

/* Error message */
.error {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    background: var(--error-bg);
    color: var(--text-color);
    font-size: 16px;
    margin-top: 8px;
    transition: all 0.3s ease;
}

.error::before {
    content: "ERROR: ";
    font-weight: bold;
}

.hidden {
    display: none;
}

/* Footer */
.footer {
    margin-top: auto;
    padding: 20px 0;
    text-align: center;
    border-top: 1px solid var(--border-color);
    width: 100%;
    max-width: 500px;
}

.footer p {
    font-size: 14px;
    opacity: 0.7;
}

.footer-link {
    color: var(--text-color);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    font-weight: bold;
}

.footer-link:hover {
    text-decoration-thickness: 2px;
}

.attribution {
    margin-top: 8px;
    font-size: 10px;
    opacity: 0.3;
    line-height: 1.2;
}

.attribution a {
    color: var(--text-color);
    text-decoration: none;
}

.attribution a:hover {
    text-decoration: underline;
    text-decoration-thickness: 1px;
}

/* Loading state */
.loading .forward-button {
    position: relative;
    color: transparent;
}

.loading .forward-button::after {
    content: "FORWARDING...";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--text-color);
    font-size: 16px;
}

.loading .forward-button:hover::after {
    color: var(--button-hover-text);
}

/* Mobile responsiveness */
@media (max-width: 480px) {
    .container {
        padding: 16px;
    }
    
    .title {
        font-size: 1.5rem;
        padding: 10px 12px;
    }
    
    .url-input {
        padding: 10px;
        font-size: 16px;
    }
    
    .forward-button {
        padding: 10px 20px;
        font-size: 16px;
    }
    
    .footer {
        padding: 16px 0;
    }
}

/* Print styles */
@media print {
    .container {
        background: #fff;
    }
    
    .title {
        background: #fff;
        color: #000;
        border: 2px solid #000;
    }
    
    .forward-button:hover {
        background: #fff;
        color: #000;
        transform: none;
        box-shadow: none;
    }
}