/* 
 * TinyLink URL Shortener - Main Stylesheet
 * Modern, responsive design with gradient backgrounds
 */

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

:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --success-color: #48bb78;
    --error-color: #f56565;
    --warning-color: #ed8936;
    --text-dark: #2d3748;
    --text-light: #718096;
    --bg-light: #f7fafc;
    --border-color: #e2e8f0;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.15);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-dark);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 40px 0;
    text-align: center;
    box-shadow: var(--shadow);
    margin-bottom: 60px;
}

.header-content {
    max-width: 600px;
    margin: 0 auto;
}

.logo {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.tagline {
    font-size: 1.1rem;
    color: var(--text-light);
}

/* Main Content */
.main-content {
    padding: 40px 0 80px;
}

/* Card Component */
.card {
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 60px;
}

.card h2 {
    font-size: 1.8rem;
    margin-bottom: 30px;
    color: var(--text-dark);
}

/* Form */
.form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 1rem;
}

.form-group input {
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group small {
    color: var(--text-light);
    font-size: 0.875rem;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    width: 100%;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--bg-light);
    color: var(--text-dark);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--border-color);
    border-color: var(--text-light);
}

.btn-copy {
    background: var(--success-color);
    color: white;
    padding: 10px 16px;
    font-size: 0.9rem;
    width: auto;
}

.btn-copy:hover:not(:disabled) {
    background: #38a169;
}

/* Loading State */
.loading-state {
    text-align: center;
    padding: 40px 20px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-state p {
    color: var(--text-light);
    font-size: 1.1rem;
}

/* Error State */
.error-state {
    background: #fff5f5;
    border-left: 4px solid var(--error-color);
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
}

.error-state p {
    color: #c53030;
    margin-bottom: 15px;
    font-weight: 500;
}

#errorMessage {
    display: block;
}

/* Success State */
.success-state {
    background: #f0fff4;
    border: 2px solid var(--success-color);
    border-radius: 8px;
    padding: 30px;
    text-align: center;
}

.success-icon {
    font-size: 3rem;
    color: var(--success-color);
    margin-bottom: 20px;
}

.success-state h3 {
    font-size: 1.5rem;
    color: var(--text-dark);
    margin-bottom: 25px;
}

.url-display {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    text-align: left;
}

.url-item {
    margin-bottom: 20px;
}

.url-item:last-child {
    margin-bottom: 0;
}

.url-item label {
    display: block;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.url-text {
    color: var(--text-light);
    word-break: break-all;
    padding: 10px;
    background: var(--bg-light);
    border-radius: 4px;
    margin: 0;
}

.short-url-container {
    display: flex;
    gap: 10px;
}

.url-input {
    flex: 1;
    padding: 10px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: var(--primary-color);
}

.button-group {
    margin-top: 20px;
}

/* Features Section */
.features-section {
    text-align: center;
    margin-bottom: 60px;
}

.features-section h2 {
    font-size: 2rem;
    color: white;
    margin-bottom: 40px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.feature-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.feature-card h3 {
    font-size: 1.2rem;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.feature-card p {
    color: var(--text-light);
    line-height: 1.6;
}

/* How It Works Section */
.how-it-works {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 50px 40px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 60px;
}

.how-it-works h2 {
    font-size: 2rem;
    color: var(--text-dark);
    text-align: center;
    margin-bottom: 40px;
}

.steps-container {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
}

.step {
    text-align: center;
    flex: 1;
    min-width: 180px;
    max-width: 220px;
}

.step-number {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 auto 15px;
}

.step h4 {
    font-size: 1.1rem;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.step p {
    color: var(--text-light);
    font-size: 0.95rem;
}

.step-arrow {
    font-size: 1.5rem;
    color: var(--primary-color);
    display: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .logo {
        font-size: 2rem;
    }

    .card {
        padding: 25px;
    }

    .card h2 {
        font-size: 1.5rem;
    }

    .how-it-works {
        padding: 30px 20px;
    }

    .steps-container {
        flex-direction: column;
    }

    .step-arrow {
        display: block;
        transform: rotate(90deg);
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .short-url-container {
        flex-direction: column;
    }

    .url-input {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 25px 0;
        margin-bottom: 30px;
    }

    .logo {
        font-size: 1.75rem;
    }

    .tagline {
        font-size: 1rem;
    }

    .card {
        padding: 20px;
    }

    .btn {
        width: 100%;
    }

    .features-section h2,
    .how-it-works h2 {
        font-size: 1.5rem;
    }
}

/* Footer */
.footer {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    color: white;
    text-align: center;
    padding: 30px 0;
    margin-top: 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.footer p {
    margin: 0;
}
