/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #333;
}

.container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 100%;
    padding: 40px;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 40px;
}

.logo {
    display: block;
    margin: 0 auto 20px auto;
    max-width: 100%;
    height: auto;
}

h1 {
    font-size: 2.5rem;
    color: #667eea;
    margin-bottom: 10px;
}

.subtitle {
    color: #666;
    font-size: 1rem;
}

/* Sections */
section {
    margin-bottom: 40px;
}

h2 {
    font-size: 1.5rem;
    color: #333;
    margin-bottom: 15px;
}

h3 {
    font-size: 1.2rem;
    color: #555;
    margin-bottom: 10px;
}

.section-description {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 15px;
}

/* Input Groups */
.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

input[type="text"] {
    flex: 1;
    padding: 14px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
}

input[type="text"]:invalid {
    border-color: #e74c3c;
}

/* Buttons */
button {
    padding: 14px 24px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s, transform 0.1s;
    white-space: nowrap;
}

button:hover {
    background: #5568d3;
}

button:active {
    transform: scale(0.98);
}

button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Error Messages */
.error-message {
    color: #e74c3c;
    font-size: 0.9rem;
    padding: 10px;
    background: #ffe6e6;
    border-radius: 6px;
    display: none;
}

.error-message.show {
    display: block;
}

/* Results Section */
.results-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    border: 2px solid #667eea;
}

.results-section.hidden {
    display: none;
}

.result-box {
    margin-bottom: 20px;
}

.short-url-display {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

#shortUrlDisplay {
    background: white;
    font-weight: 600;
    color: #667eea;
}

.copy-btn {
    background: #28a745;
    min-width: 120px;
}

.copy-btn:hover {
    background: #218838;
}

.copy-btn.copied {
    background: #5cb85c;
}

.expires-info {
    color: #666;
    font-size: 0.85rem;
    font-style: italic;
}

/* QR Code */
.qr-code-container {
    text-align: center;
}

#qrCode {
    margin: 0 auto;
    display: block;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px;
    background: white;
}

/* Footer */
footer {
    text-align: center;
    color: #999;
    font-size: 0.85rem;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.footer-links {
    margin-top: 10px;
}

.footer-links a {
    color: #667eea;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: #5568d3;
    text-decoration: underline;
}

.footer-links .separator {
    margin: 0 10px;
    color: #ccc;
}

/* Responsive Design */
@media (max-width: 600px) {
    .container {
        padding: 24px;
    }

    h1 {
        font-size: 2rem;
    }

    .input-group {
        flex-direction: column;
    }

    button {
        width: 100%;
    }

    .short-url-display {
        flex-direction: column;
    }

    .copy-btn {
        width: 100%;
    }
}

/* Loading State */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
