/* ============================
   RESET Y VARIABLES
   ============================ */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #a5b4fc;
    --secondary: #ec4899;
    --accent: #f59e0b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --bg: #f8fafc;
    --card: #ffffff;
    --text: #1e293b;
    --text-light: #64748b;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
    --shadow-md: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
    --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);
    --shadow-glow: 0 0 20px rgba(99,102,241,0.3);
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    background-image: 
        radial-gradient(at 20% 30%, rgba(99,102,241,0.08) 0px, transparent 50%),
        radial-gradient(at 80% 70%, rgba(236,72,153,0.08) 0px, transparent 50%);
    background-attachment: fixed;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ============================
   HEADER MODERNO
   ============================ */
.main-header {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    text-decoration: none;
    color: var(--text);
}

.logo-icon {
    font-size: 2.5rem;
    filter: drop-shadow(0 2px 4px rgba(99,102,241,0.3));
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.logo-text h1 {
    font-size: 1.4rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.logo-text p {
    font-size: 0.75rem;
    color: var(--text-light);
    font-weight: 400;
}

.main-nav {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.nav-link {
    color: var(--text);
    text-decoration: none;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius);
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
    position: relative;
}

.nav-link:hover {
    background: var(--border-light);
    color: var(--primary);
    transform: translateY(-1px);
}

.btn-ingresar {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white !important;
    box-shadow: var(--shadow);
}

.btn-ingresar:hover {
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.4rem 0.8rem 0.4rem 0.4rem;
    background: var(--border-light);
    border-radius: 50px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text);
}

.btn-logout {
    color: var(--text-light);
    text-decoration: none;
    font-size: 1.1rem;
    padding: 0.3rem;
    border-radius: 50%;
    transition: var(--transition);
}

.btn-logout:hover {
    background: var(--danger);
    color: white;
    transform: rotate(15deg);
}

/* ============================
   MAIN
   ============================ */
main { 
    padding: 2.5rem 0; 
    min-height: calc(100vh - 200px); 
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.page-subtitle {
    color: var(--text-light);
    margin-bottom: 2rem;
    font-size: 1.05rem;
}

/* ============================
   HERO (página de ideas pública)
   ============================ */
.hero {
    background: linear-gradient(135deg, rgba(99,102,241,0.9), rgba(236,72,153,0.9));
    color: white;
    padding: 3rem 2rem;
    border-radius: var(--radius-xl);
    margin-bottom: 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(255,255,255,0.15), transparent);
    border-radius: 50%;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(245,158,11,0.2), transparent);
    border-radius: 50%;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.hero p {
    font-size: 1.15rem;
    max-width: 600px;
    margin: 0 auto;
    opacity: 0.95;
}

/* ============================
   CARDS / FORMS
   ============================ */
.card {
    background: var(--card);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-light);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.form-group { margin-bottom: 1.5rem; }

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text);
    font-size: 0.95rem;
}

.form-group label .required { color: var(--danger); margin-left: 2px; }

.form-control {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
    background: var(--card);
    color: var(--text);
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99,102,241,0.1);
}

.form-control:hover:not(:focus) {
    border-color: var(--text-muted);
}

textarea.form-control { 
    resize: vertical; 
    min-height: 130px;
    line-height: 1.6;
}

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3e%3cpath fill='%2364748b' d='M6 9L1 4h10z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.form-error {
    color: var(--danger);
    font-size: 0.85rem;
    margin-top: 0.4rem;
    display: none;
    font-weight: 500;
}

.form-error.visible { display: block; animation: shake 0.3s; }

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* ============================
   BOTONES MODERNOS
   ============================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1.8rem;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn:active { transform: scale(0.98); }

.btn-primary { 
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: var(--shadow);
}

.btn-primary:hover {
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.btn-success { 
    background: linear-gradient(135deg, var(--success), #059669);
    color: white;
    box-shadow: var(--shadow);
}

.btn-success:hover {
    box-shadow: 0 0 20px rgba(16,185,129,0.4);
    transform: translateY(-2px);
}

.btn-accent { 
    background: linear-gradient(135deg, var(--accent), #d97706);
    color: white;
    box-shadow: var(--shadow);
}

.btn-accent:hover {
    box-shadow: 0 0 20px rgba(245,158,11,0.4);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

/* ============================
   ALERTAS
   ============================ */
.alert {
    padding: 1rem 1.3rem;
    border-radius: var(--radius);
    margin-bottom: 1.2rem;
    border-left: 4px solid;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    animation: slideIn 0.4s ease-out;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.alert-success { 
    background: linear-gradient(135deg, #d1fae5, #a7f3d0); 
    border-color: var(--success); 
    color: #065f46; 
}

.alert-danger { 
    background: linear-gradient(135deg, #fee2e2, #fecaca); 
    border-color: var(--danger); 
    color: #991b1b; 
}

.alert-info { 
    background: linear-gradient(135deg, #dbeafe, #bfdbfe); 
    border-color: var(--info); 
    color: #1e40af; 
}

/* ============================
   LOGIN
   ============================ */
.auth-container {
    max-width: 450px;
    margin: 2rem auto;
}

.auth-card {
    background: var(--card);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: inline-block;
    animation: float 3s ease-in-out infinite;
}

.auth-header h2 {
    font-size: 1.8rem;
    color: var(--text);
    margin-bottom: 0.3rem;
}

.auth-header p {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* ============================
   FILTROS
   ============================ */
.filtros {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
}

.filtros > div label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filtros > div:last-child {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
}

/* ============================
   LISTADO DE IDEAS
   ============================ */
.stats-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.stat-card {
    flex: 1;
    min-width: 150px;
    background: var(--card);
    padding: 1.2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
}

.stat-info h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
}

.stat-info p {
    font-size: 0.85rem;
    color: var(--text-light);
}

.ideas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.5rem;
}

.idea-card {
    background: var(--card);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.idea-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.idea-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.idea-card .categoria {
    display: inline-block;
    padding: 0.35rem 0.9rem;
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    color: white;
    border-radius: 50px;
    font-size: 0.8rem;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 0.8rem;
    box-shadow: var(--shadow-sm);
}

.idea-card h3 {
    color: var(--text);
    margin-bottom: 0.7rem;
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.3;
}

.idea-card p {
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.idea-card .meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.estado-badge {
    display: inline-block;
    padding: 0.2rem 0.7rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.estado-pendiente { background: #fef3c7; color: #92400e; }
.estado-en_revision { background: #dbeafe; color: #1e40af; }
.estado-resuelta { background: #d1fae5; color: #065f46; }

.empty-state {
    text-align: center;
    padding: 4rem 1rem;
    color: var(--text-light);
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text);
}

/* ============================
   FOOTER
   ============================ */
.main-footer {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    color: white;
    padding: 3rem 0 0 0;
    margin-top: 3rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
    padding-bottom: 2rem;
}

.footer-section h3, .footer-section h4 {
    margin-bottom: 1rem;
    color: white;
}

.footer-section h3 {
    font-size: 1.3rem;
    background: linear-gradient(135deg, var(--primary-light), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-section p, .footer-section li {
    color: #cbd5e1;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section a {
    color: #cbd5e1;
    text-decoration: none;
    transition: var(--transition);
}

.footer-section a:hover {
    color: var(--primary-light);
    padding-left: 5px;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 1.2rem 0;
    text-align: center;
    color: #94a3b8;
    font-size: 0.9rem;
}

/* ============================
   RESPONSIVE - 1080p (>= 1080px)
   ============================ */
@media (min-width: 1080px) {
    .container { max-width: 1280px; }
    .logo-text h1 { font-size: 1.6rem; }
    .hero h2 { font-size: 3rem; }
}

/* ============================
   RESPONSIVE - TABLET (768px)
   ============================ */
@media (max-width: 768px) {
    .header-content { 
        flex-direction: column; 
        text-align: center;
        gap: 1rem;
    }
    .main-nav { 
        justify-content: center; 
        width: 100%;
    }
    .card { padding: 1.5rem; }
    .filtros { 
        grid-template-columns: 1fr 1fr; 
        padding: 1.2rem;
    }
    .ideas-grid { grid-template-columns: 1fr; }
    .page-title { font-size: 1.6rem; }
    .hero { padding: 2rem 1.5rem; }
    .hero h2 { font-size: 1.8rem; }
    .hero p { font-size: 1rem; }
    .stats-bar { flex-direction: column; }
}

/* ============================
   RESPONSIVE - MÓVIL (< 480px)
   ============================ */
@media (max-width: 480px) {
    .container { padding: 0 16px; }
    .main-header { padding: 0.8rem 0; }
    .logo-icon { font-size: 2rem; }
    .logo-text h1 { font-size: 1.1rem; }
    .logo-text p { font-size: 0.7rem; }
    .main-nav { gap: 0.5rem; }
    .nav-link { 
        padding: 0.5rem 0.8rem; 
        font-size: 0.85rem; 
    }
    .user-name { display: none; }
    .card { padding: 1.2rem; }
    .filtros { 
        grid-template-columns: 1fr; 
        padding: 1rem;
    }
    .btn { 
        width: 100%; 
        padding: 0.85rem;
    }
    .form-control { 
        font-size: 0.95rem; 
        padding: 0.75rem 0.9rem;
    }
    .hero { padding: 1.5rem 1rem; }
    .hero h2 { font-size: 1.5rem; }
    .auth-card { padding: 1.5rem; }
    .footer-content { grid-template-columns: 1fr; text-align: center; }
}