:root {
    --color-primary: #1a1a1a;
    --color-secondary: #4a4a4a;
    --color-accent: #d4af37;
    --color-bg: #fafaf8;
    --color-surface: #ffffff;
    --color-border: #e5e5e0;
    --color-text: #2a2a2a;
    --color-text-light: #6a6a6a;
    --color-success: #2d5016;
    --color-error: #8b1e1e;
    
    --font-display: 'Cormorant Garamond', serif;
    --font-body: 'Work Sans', sans-serif;
    
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.08);
}

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

body {
    font-family: var(--font-body);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Textura de grano sutil */
.grain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.03;
    z-index: 1;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* Header */
header {
    position: relative;
    z-index: 10;
    padding: 2rem 2rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    font-size: 1.5rem;
    color: var(--color-accent);
    animation: rotate 20s linear infinite;
}

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

.logo h1 {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 300;
    letter-spacing: 0.05em;
    color: var(--color-primary);
}

.admin-link {
    font-size: 0.9rem;
    color: var(--color-text-light);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    transition: all 0.3s ease;
}

.admin-link:hover {
    background: var(--color-primary);
    color: var(--color-surface);
    border-color: var(--color-primary);
}

/* Container */
.container {
    position: relative;
    z-index: 10;
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    flex: 1;
}

/* Hero */
.hero {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInUp 0.8s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-title {
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 300;
    color: var(--color-primary);
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.125rem;
    color: var(--color-text-light);
    font-weight: 300;
    max-width: 500px;
    margin: 0 auto;
}

/* Form Card */
.form-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 2.5rem;
    box-shadow: var(--shadow-sm);
    animation: fadeInUp 0.8s ease 0.2s backwards;
}

.input-group {
    margin-bottom: 2rem;
}

.input-group label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text);
    margin-bottom: 0.5rem;
    letter-spacing: 0.02em;
}

.badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    background: var(--color-bg);
    border-radius: 3px;
    color: var(--color-text-light);
    font-weight: 400;
}

.input-group input {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    font-family: var(--font-body);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    background: var(--color-bg);
    color: var(--color-text);
    transition: all 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: var(--color-primary);
    background: var(--color-surface);
    box-shadow: 0 0 0 3px rgba(26, 26, 26, 0.05);
}

.input-hint {
    display: block;
    font-size: 0.8rem;
    color: var(--color-text-light);
    margin-top: 0.5rem;
    font-style: italic;
}

.btn-primary {
    width: 100%;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 500;
    font-family: var(--font-body);
    background: var(--color-primary);
    color: var(--color-surface);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    letter-spacing: 0.02em;
}

.btn-primary:hover {
    background: var(--color-secondary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

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

/* Resultado */
.resultado {
    margin-top: 2rem;
    padding: 2rem;
    background: linear-gradient(135deg, #f0f9f4 0%, #e8f5e9 100%);
    border: 1px solid #c8e6c9;
    border-radius: 8px;
    animation: slideIn 0.5s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.resultado-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.resultado-header svg {
    color: var(--color-success);
}

.resultado-header h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--color-success);
}

.enlace-corto {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.enlace-corto input {
    flex: 1;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    font-family: monospace;
    border: 1px solid #a5d6a7;
    border-radius: 4px;
    background: white;
    color: var(--color-primary);
}

.btn-copy {
    padding: 0.875rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    font-family: var(--font-body);
    background: var(--color-success);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-copy:hover {
    background: #1e3a0f;
}

.resultado-info {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.info-item {
    display: flex;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.info-label {
    font-weight: 500;
    color: var(--color-success);
    min-width: 80px;
}

.info-value {
    color: var(--color-text-light);
    word-break: break-all;
}

/* Features */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-top: 4rem;
    animation: fadeInUp 0.8s ease 0.4s backwards;
}

.feature {
    text-align: center;
}

.feature-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 1rem;
}

.feature h3 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 400;
    color: var(--color-primary);
    margin-bottom: 0.5rem;
}

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

/* Footer */
footer {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 2rem;
    color: var(--color-text-light);
    font-size: 0.875rem;
    border-top: 1px solid var(--color-border);
    margin-top: 4rem;
}

/* Admin Styles */
.admin-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.admin-header h2 {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 300;
    color: var(--color-primary);
}

.btn-secondary {
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    font-family: var(--font-body);
    background: var(--color-surface);
    color: var(--color-primary);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: var(--color-bg);
    border-color: var(--color-primary);
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.stat-value {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 300;
    color: var(--color-primary);
    display: block;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--color-text-light);
    margin-top: 0.5rem;
}

.enlaces-table {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background: var(--color-bg);
    padding: 1rem;
    text-align: left;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text);
    border-bottom: 1px solid var(--color-border);
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.875rem;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover {
    background: var(--color-bg);
}

.enlace-cell {
    font-family: monospace;
    color: var(--color-accent);
}

.url-cell {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--color-text-light);
}

.btn-delete {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    background: var(--color-error);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-delete:hover {
    background: #5e1414;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .form-card {
        padding: 1.5rem;
    }
    
    .enlace-corto {
        flex-direction: column;
    }
    
    .features {
        grid-template-columns: 1fr;
    }
    
    table {
        font-size: 0.75rem;
    }
    
    th, td {
        padding: 0.75rem 0.5rem;
    }
}
