:root {
    --primary-color: #007bff;
    --primary-hover: #0056b3;
    --background-color: #f0f2f5;
    --surface-color: #ffffff;
    --text-color-primary: #1c1e21;
    --text-color-secondary: #65676b;
    --border-color: #ddd;
    --header-height: 70px;
    --border-radius: 8px;
    --container-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--background-color);
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding-top: calc(var(--header-height) + 30px);
    padding-bottom: 40px;
    padding-left: 20px;
    padding-right: 20px;
    box-sizing: border-box;
    width: 100%;
}

aside {
    width: 100%;
    padding: 20px;
    text-align: center;
    box-sizing: border-box;
    background-color: var(--surface-color);
    border-top: 1px solid #e0e0e0;
}

aside a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

aside a:hover {
    text-decoration: underline;
}

.header {
    background: var(--surface-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    height: var(--header-height);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    height: 100%;
    margin: 0 auto;
    padding: 0 20px;
}

.logo a {
    font-size: 24px;
    font-weight: bold;
    color: #333;
    text-decoration: none;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 30px;
    margin: 0;
    padding: 0;
}

.nav-links a {
    text-decoration: none;
    color: #555;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--primary-color);
}

.container {
    background: var(--surface-color);
    padding: 30px 40px;
    border-radius: 12px;
    box-shadow: var(--container-shadow);
    text-align: center;
    max-width: 500px;
    width: 100%;
}

h1 {
    margin-top: 0;
    font-size: 28px;
    color: var(--text-color-primary);
}

.subtitle {
    color: var(--text-color-secondary);
    margin-bottom: 25px;
    font-size: 16px;
    line-height: 1.5;
}

#shorten-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#long-url {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 16px;
    box-sizing: border-box;
}

#shorten-form button {
    width: 100%;
    padding: 12px 20px;
    border: none;
    background: linear-gradient(45deg, var(--primary-color), var(--primary-hover));
    color: white;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#shorten-form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

#shorten-form button:disabled {
    background: #aab8c5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

#result {
    margin-top: 30px;
    text-align: left;
}

.short-url-container {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: #e9ecef;
    padding: 10px;
    border-radius: var(--border-radius);
    margin-top: -15px;
}

#short-url {
    flex-grow: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--primary-hover);
    font-weight: bold;
    text-decoration: none;
}

#short-url:hover {
    text-decoration: underline;
}

#copy-btn, #share-link-btn {
    padding: 8px 15px;
    border: none;
    color: white;
    border-radius: 5px;
    cursor: pointer;
    flex-shrink: 0;
}
#copy-btn { background-color: #28a745; }
#share-link-btn { background-color: var(--primary-color); }

.qr-code-container {
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid #eee;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

#qr-code-image {
    max-width: 200px;
    width: 100%;
    height: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
}

.qr-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    width: 100%;
}

.button-download, .button-share {
    display: inline-block;
    padding: 10px 20px;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: background-color 0.3s;
    border: none;
    cursor: pointer;
    font-size: 14px;
    flex-grow: 1;
    max-width: 200px;
}
.button-download { background-color: #17a2b8; }
.button-download:hover { background-color: #138496; }
.button-share { background-color: #6c757d; }
.button-share:hover { background-color: #5a6268; }

#preview-image {
    width: 100%;
    max-height: 250px;
    object-fit: cover;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    border: 1px solid #eee;
}

#page-description.description {
    border-top: 1px solid #eee;
    padding-top: 20px;
    margin-top: 20px;
    font-size: 14px;
}

.destination { 
    background-color: #f8f9fa; 
    padding: 12px 15px; 
    border-radius: var(--border-radius); 
    font-family: "Courier New", Courier, monospace;
    word-wrap: break-word;
    margin-top: 5px;
    color: #555;
    text-align: left;
    border: 1px solid #eee;
}

.countdown {
    font-weight: bold;
    font-size: 18px;
    margin-top: 25px;
}

#transit-share-actions {
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid #eee;
}

#transit-share-actions .button-share {
    width: 100%;
}

.container.static-page {
    text-align: left;
    max-width: 800px;
}
.static-page h2 {
    margin-top: 30px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}
.static-page ul { padding-left: 20px; }
.static-page li { margin-bottom: 10px; }

#recent-links-section {
    margin-top: 30px;
}
#recent-links-section h2 {
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
}
#recent-links-list {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: left;
}
#recent-links-list li {
    padding: 15px 10px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
#recent-links-list li:last-child { border-bottom: none; }
#recent-links-list a {
    font-weight: 500;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 16px;
    word-break: break-all;
}
#recent-links-list a:hover { text-decoration: underline; }
#recent-links-list .link-title {
    font-size: 14px;
    color: var(--text-color-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.loading-placeholder, .error-placeholder {
    color: var(--text-color-secondary);
    text-align: center;
    padding: 20px;
}

.text-error {
    color: #dc3545;
    font-weight: bold;
    margin-top: 15px;
    text-align: center;
}

.hidden { display: none !important; }

.hamburger {
    display: none;
    cursor: pointer;
}
.hamburger .bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    transition: all 0.3s ease-in-out;
    background-color: #333;
}

@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        left: -100%;
        top: var(--header-height);
        gap: 0;
        flex-direction: column;
        background-color: var(--surface-color);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
    }
    .nav-links.active { left: 0; }
    .nav-links li {
        padding: 15px 0;
        border-bottom: 1px solid #f0f0f0;
    }
    .nav-links li:last-child { border-bottom: none; }
    .hamburger { display: block; }
    .hamburger.active .bar:nth-child(2) { opacity: 0; }
    .hamburger.active .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .hamburger.active .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
    .container { padding: 20px; }
}