/* Modern Styles for SPIDYURL, inspired by SPIDYURL */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');

:root {
    --bg-color: #1a5266;
    --bg-mid: #1f6f8b;
    --bg-light: #31a5bd;
    --card-bg: #ffffff;
    --primary-text: #ffffff;
    --secondary-text: #e0e7ef;
    --accent-green: #28a745;
    --accent-green-dark: #218838;
    --border-color: #e1e8ed;
    --border-radius: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 16px;
    --background-white: #ffffff;
    --background-light: #f8f9fa;
    --text-dark: #2c3e50;
    --text-light: #5a6b7b;
    --primary-blue: #1a5266;
    --primary-blue-dark: #144252;
    --secondary-blue: #1f6f8b;
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #1a5266 0%, #1f6f8b 50%, #31a5bd 100%);
    color: var(--primary-text);
    line-height: 1.6;
    position: relative;
    min-height: 100vh;
    overflow-x: hidden;
}

.background-waves {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
}

.background-waves::before {
    content: '';
    position: absolute;
    top: -10%;
    right: 20%;
    width: 500px;
    height: 500px;
    background: rgba(73, 160, 180, 0.3);
    border-radius: 45% 55% 60% 40% / 50% 45% 55% 50%;
    animation: blob1 8s ease-in-out infinite;
}

.background-waves::after {
    content: '';
    position: absolute;
    bottom: -10%;
    left: 10%;
    width: 400px;
    height: 400px;
    background: rgba(26, 82, 102, 0.4);
    border-radius: 60% 40% 45% 55% / 55% 50% 50% 45%;
    animation: blob2 10s ease-in-out infinite;
}

@keyframes blob1 {
    0%, 100% {
        transform: translate(0, 0) scale(1) rotate(0deg);
    }
    33% {
        transform: translate(30px, -50px) scale(1.1) rotate(120deg);
    }
    66% {
        transform: translate(-20px, 20px) scale(0.9) rotate(240deg);
    }
}

@keyframes blob2 {
    0%, 100% {
        transform: translate(0, 0) scale(1) rotate(0deg);
    }
    33% {
        transform: translate(-30px, 50px) scale(1.05) rotate(-120deg);
    }
    66% {
        transform: translate(40px, -30px) scale(0.95) rotate(-240deg);
    }
}

.main-header {
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: absolute;
    width: 100%;
    top: 0;
    left: 0;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: #ffffff;
    text-decoration: none;
}

.nav-toggle {
    background: none;
    border: 2px solid #ffffff;
    border-radius: 8px;
    padding: 0.5rem;
    cursor: pointer;
}

.nav-toggle .icon-bar {
    display: block;
    width: 24px;
    height: 3px;
    background-color: #ffffff;
    margin: 5px 0;
    transition: transform 0.3s;
}

.container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 2rem;
}

.main-card {
    background: var(--card-bg);
    border-radius: var(--border-radius-lg);
    padding: 2.5rem;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 500px;
    margin-top: 8rem; /* Space for header */
    color: #2c3e50;
}

.main-card *,
.main-card p,
.main-card ul,
.main-card li,
.main-card label,
.main-card span,
.main-card strong,
.main-card div,
.main-card a {
    color: #2c3e50 !important;
}

.main-card h1,
.main-card h2,
.main-card h3,
.main-card h4 {
    color: #1a1a1a !important;
}

.form-section {
    margin-bottom: 2rem;
}

.form-section h2 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 1rem;
}

.input-field {
    width: 100%;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    font-size: 1rem;
    color: #2c3e50;
}

.input-field:focus {
    outline: none;
    border-color: var(--accent-green);
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
}

.alias-group {
    display: flex;
    gap: 0.5rem;
}

.alias-domain {
    padding: 1rem;
    background-color: #f8f9fa;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md) 0 0 var(--border-radius-md);
    font-weight: 600;
    white-space: nowrap;
    color: #2c3e50;
}

.alias-input {
    border-left: none;
    border-radius: 0 var(--border-radius-md) var(--border-radius-md) 0;
}

.shorten-btn {
    width: 100%;
    padding: 1.25rem;
    background: var(--accent-green);
    color: #fff;
    border: none;
    border-radius: var(--border-radius-md);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.3s;
}

.shorten-btn:hover {
    background: var(--accent-green-dark);
}

.shorten-btn:disabled {
    background-color: #a0aec0;
    cursor: not-allowed;
}

.loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-right: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.result-section {
    margin-bottom: 1.5rem;
}

.result-section label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.action-btn {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    background-color: #fff;
    color: #2c3e50;
    cursor: pointer;
    transition: background-color 0.3s;
}

.action-btn:hover {
    background-color: #f8f9fa;
}

.copy-btn {
    background-color: var(--accent-green);
    color: #fff;
}

.copy-btn:hover {
    background-color: var(--accent-green-dark);
}

.footer-buttons {
    display: flex;
    gap: 0.5rem;
}

.footer-btn {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    background-color: #fff;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    color: #2c3e50;
}

.footer-btn.primary {
    background-color: var(--accent-green);
    color: #fff;
}

.main-content {
    text-align: center;
    color: #ffffff;
    margin-top: 4rem;
}

.main-content h1 {
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.main-content p {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto;
    opacity: 0.9;
}

footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    text-align: center;
    padding: 1.5rem;
    color: var(--primary-text);
    font-size: 0.9rem;
}

footer a {
    color: var(--primary-text);
    text-decoration: none;
    margin: 0 0.5rem;
}

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

/* Side Navigation */
.side-nav {
    position: fixed;
    top: 0;
    right: -300px; /* Hidden by default */
    width: 300px;
    height: 100%;
    background-color: #fff;
    box-shadow: -10px 0 30px rgba(0,0,0,0.1);
    transition: right 0.3s ease-in-out;
    z-index: 1000;
    padding: 2rem;
}

.side-nav.open {
    right: 0;
}

.close-nav {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: none;
    border: none;
    font-size: 2rem;
    color: #2c3e50;
    cursor: pointer;
}

.side-nav a {
    display: block;
    color: #2c3e50;
    text-decoration: none;
    font-size: 1.2rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

.side-nav a:hover {
    color: var(--accent-green);
}

/* Responsive */
@media (max-width: 768px) {
    .main-card {
        margin-top: 6rem;
        padding: 2rem;
    }
    .main-content h1 {
        font-size: 2.2rem;
    }
}