/* ============================================
   AIA Consultores y Constructores
   Módulo Clientes – Professional Redesign v3.0
   Paleta: Azul #030083 | Naranja #fe7f00 | Gris #d9d9d9 | Celeste #51d1f6
   ============================================ */

/* === DESIGN TOKENS === */
:root {
    /* Brand Colors */
    --clr-blue: #030083;
    --clr-blue-light: #0a00b8;
    --clr-orange: #fe7f00;
    --clr-orange-light: #ff9a33;
    --clr-gray: #d9d9d9;
    --clr-gray-dark: #a3a3a3;
    --clr-cyan: #51d1f6;
    --clr-cyan-light: #7edcf8;
    --clr-white: #ffffff;
    --clr-dark: #020052;

    /* Backgrounds */
    --bg-page: #f5f7fb;
    --bg-card: #ffffff;
    --bg-hero: linear-gradient(135deg, #020052 0%, #030083 40%, #0a00b8 100%);

    /* Typography */
    --text-primary: #1a1a2e;
    --text-secondary: #555b6e;
    --text-on-dark: rgba(255, 255, 255, 0.85);
    --text-on-dark-muted: rgba(255, 255, 255, 0.55);

    /* Borders & Shadows */
    --border-subtle: rgba(3, 0, 131, 0.08);
    --shadow-card: 0 4px 24px rgba(3, 0, 131, 0.06);
    --shadow-card-hover: 0 16px 48px rgba(3, 0, 131, 0.14);
    --shadow-glow-orange: 0 8px 32px rgba(254, 127, 0, 0.25);
    --shadow-glow-cyan: 0 8px 32px rgba(81, 209, 246, 0.25);

    /* Radius */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --radius-full: 9999px;

    /* Transitions */
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-smooth: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --transition-fast: 0.25s var(--ease-smooth);
    --transition-med: 0.4s var(--ease-smooth);
    --transition-slow: 0.6s var(--ease-smooth);
}

/* === RESET & BASE === */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    
    background-color: var(--bg-page);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* === BACKGROUND PATTERN (subtle dot grid) === */
.bg-gradient-blur {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 1px 1px, rgba(3, 0, 131, 0.03) 1px, transparent 0);
    background-size: 32px 32px;
    z-index: -1;
    pointer-events: none;
}

/* === HERO SECTION === */
.hero-section {
    background: var(--bg-hero);
    position: relative;
    padding: 100px 24px 80px;
    overflow: hidden;
    text-align: center;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(81, 209, 246, 0.12) 0%, transparent 70%);
    border-radius: 50%;
    animation: heroGlow 8s ease-in-out infinite alternate;
}

.hero-section::after {
    content: '';
    position: absolute;
    bottom: -40%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(254, 127, 0, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    animation: heroGlow 8s ease-in-out 2s infinite alternate;
}

@keyframes heroGlow {
    0% { transform: scale(1) translate(0, 0); }
    100% { transform: scale(1.2) translate(30px, -20px); }
}

/* Floating geometric shapes */
.hero-shapes {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.hero-shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.08;
}

.hero-shape--1 {
    width: 200px;
    height: 200px;
    background: var(--clr-cyan);
    top: 10%;
    right: 8%;
    animation: floatShape 12s ease-in-out infinite;
}

.hero-shape--2 {
    width: 120px;
    height: 120px;
    background: var(--clr-orange);
    bottom: 15%;
    left: 5%;
    animation: floatShape 10s ease-in-out 2s infinite reverse;
}

.hero-shape--3 {
    width: 80px;
    height: 80px;
    background: var(--clr-gray);
    top: 30%;
    left: 15%;
    border-radius: var(--radius-md);
    animation: floatShape 14s ease-in-out 4s infinite;
    transform: rotate(45deg);
}

@keyframes floatShape {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-20px) rotate(5deg); }
    50% { transform: translateY(10px) rotate(-3deg); }
    75% { transform: translateY(-15px) rotate(2deg); }
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    background: rgba(81, 209, 246, 0.12);
    border: 1px solid rgba(81, 209, 246, 0.25);
    border-radius: var(--radius-full);
    color: var(--clr-cyan-light);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    margin-bottom: 24px;
    animation: fadeInDown 0.6s var(--ease-smooth) both;
}

.hero-badge i {
    font-size: 0.7rem;
}

.hero-title {
    font-size: clamp(2.2rem, 5vw, 3.6rem);
    font-weight: 800;
    color: var(--clr-white);
    line-height: 1.15;
    margin-bottom: 20px;
    letter-spacing: -0.03em;
    animation: fadeInDown 0.6s var(--ease-smooth) 0.1s both;
}

.hero-title .highlight {
    background: linear-gradient(135deg, var(--clr-orange), var(--clr-orange-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-desc {
    font-size: 1.1rem;
    color: var(--text-on-dark);
    max-width: 620px;
    margin: 0 auto 36px;
    line-height: 1.7;
    animation: fadeInDown 0.6s var(--ease-smooth) 0.2s both;
}

.hero-desc .accent {
    color: var(--clr-cyan-light);
    font-weight: 600;
}

/* Stats bar inside hero */
.hero-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    animation: fadeInUp 0.6s var(--ease-smooth) 0.3s both;
}

.hero-stat {
    text-align: center;
}

.hero-stat__number {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    color: var(--clr-white);
    line-height: 1;
    margin-bottom: 4px;
}

.hero-stat__number .stat-accent {
    color: var(--clr-orange);
}

.hero-stat__label {
    font-size: 0.75rem;
    color: var(--text-on-dark-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 600;
}

/* Dividers between stats */
.hero-stat + .hero-stat {
    position: relative;
    padding-left: 40px;
}

.hero-stat + .hero-stat::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10%;
    height: 80%;
    width: 1px;
    background: rgba(255, 255, 255, 0.15);
}

/* Wave divider at bottom of hero */
.hero-wave {
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    line-height: 0;
}

.hero-wave svg {
    width: 100%;
    height: 60px;
    display: block;
}

/* === MAIN CONTAINER === */
.container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 60px 24px 80px;
}

/* === PAGE HEADER (kept for backwards compat, now restyled) === */
.page-header {
    text-align: center;
    margin-bottom: 60px;
}

.sub-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--clr-orange);
    text-transform: uppercase;
    letter-spacing: 2.5px;
    margin-bottom: 16px;
    padding: 6px 18px;
    background: rgba(254, 127, 0, 0.08);
    border: 1px solid rgba(254, 127, 0, 0.15);
    border-radius: var(--radius-full);
}

.main-title {
    font-size: clamp(2rem, 4.5vw, 2.8rem);
    font-weight: 800;
    color: var(--clr-blue);
    margin-bottom: 16px;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.main-title .highlight {
    background: linear-gradient(135deg, var(--clr-orange), var(--clr-orange-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-desc {
    font-size: 1.05rem;
    color: var(--text-secondary);
    max-width: 680px;
    margin: 0 auto;
    line-height: 1.7;
}

/* === FILTER TABS === */
.filter-tabs {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 48px;
    flex-wrap: wrap;
}

.filter-tab {
    padding: 10px 24px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-subtle);
    background: var(--clr-white);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
}

.filter-tab:hover {
    border-color: var(--clr-cyan);
    color: var(--clr-blue);
    background: rgba(81, 209, 246, 0.06);
}

.filter-tab.active {
    background: var(--clr-blue);
    color: var(--clr-white);
    border-color: var(--clr-blue);
    box-shadow: 0 4px 16px rgba(3, 0, 131, 0.2);
}

/* === GRID LAYOUT === */
.clients-grid-wrapper {
    position: relative;
}

.clients-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 28px;
    margin-bottom: 56px;
}

/* === CARD DESIGN === */
.client-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 0;
    display: flex;
    flex-direction: column;
    transition: transform var(--transition-med), box-shadow var(--transition-med), border-color var(--transition-med);
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
    opacity: 0;
    animation: cardReveal 0.55s var(--ease-smooth) forwards;
}

@keyframes cardReveal {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.client-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-card-hover);
    border-color: transparent;
}

/* Top accent stripe */
.client-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    transition: height var(--transition-fast);
}

.client-card:hover::before {
    height: 5px;
}

/* Color variants */
.client-card.orange::before {
    background: linear-gradient(90deg, var(--clr-orange), var(--clr-orange-light));
}

.client-card.blue::before {
    background: linear-gradient(90deg, var(--clr-blue), var(--clr-blue-light));
}

.client-card.cyan::before {
    background: linear-gradient(90deg, var(--clr-cyan), var(--clr-cyan-light));
}

.client-card.gray::before {
    background: linear-gradient(90deg, var(--clr-gray-dark), var(--clr-gray));
}

/* Card internal structure */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 28px 0;
}

.service-tag {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 5px 14px;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    transition: var(--transition-fast);
}

/* Service tag color variants */
.orange .service-tag {
    background: rgba(254, 127, 0, 0.08);
    color: var(--clr-orange);
    border: 1px solid rgba(254, 127, 0, 0.18);
}

.blue .service-tag {
    background: rgba(3, 0, 131, 0.06);
    color: var(--clr-blue);
    border: 1px solid rgba(3, 0, 131, 0.12);
}

.cyan .service-tag {
    background: rgba(81, 209, 246, 0.08);
    color: #0891b2;
    border: 1px solid rgba(81, 209, 246, 0.18);
}

.gray .service-tag {
    background: rgba(163, 163, 163, 0.1);
    color: #6b7280;
    border: 1px solid rgba(163, 163, 163, 0.2);
}

/* Star rating (visual) */
.card-rating {
    display: flex;
    gap: 2px;
}

.card-rating i {
    font-size: 0.72rem;
    color: var(--clr-orange);
}

/* Card body */
.card-body {
    flex-grow: 1;
    padding: 20px 28px;
}

.comment {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-style: italic;
    line-height: 1.75;
    position: relative;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    transition: color var(--transition-fast);
    padding-left: 20px;
}

.comment::before {
    content: '\201C';
    
    font-size: 3.5rem;
    color: rgba(3, 0, 131, 0.06);
    position: absolute;
    top: -16px;
    left: -4px;
    line-height: 1;
    z-index: 0;
}

.comment.expanded {
    -webkit-line-clamp: unset;
    display: block;
    overflow: visible;
}

.comment:hover {
    color: var(--clr-blue);
}

/* Read more indicator */
.comment::after {
    content: 'Leer más';
    position: absolute;
    bottom: 0;
    right: 0;
    font-size: 0.75rem;
    font-weight: 700;
    font-style: normal;
    color: var(--clr-cyan);
    background: linear-gradient(90deg, transparent, white 40%);
    padding-left: 40px;
    letter-spacing: 0.3px;
}

.comment.expanded::after {
    content: none;
}

/* Card footer */
.card-footer {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 28px;
    border-top: 1px solid rgba(3, 0, 131, 0.05);
    background: rgba(245, 247, 251, 0.5);
}

.client-avatar {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    object-fit: cover;
    border: 2px solid rgba(3, 0, 131, 0.06);
    transition: var(--transition-fast);
}

.client-card:hover .client-avatar {
    border-color: var(--clr-cyan);
    transform: scale(1.05);
}

.client-meta {
    flex: 1;
    min-width: 0;
}

.client-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.client-role {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin: 2px 0 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Card hover glow effect */
.client-card.orange:hover {
    box-shadow: var(--shadow-glow-orange);
}

.client-card.cyan:hover {
    box-shadow: var(--shadow-glow-cyan);
}

.client-card.blue:hover {
    box-shadow: 0 16px 48px rgba(3, 0, 131, 0.16);
}

/* === PAGINATION === */
.pagination-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 24px;
    padding: 12px 24px;
    background: var(--clr-white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-subtle);
    width: fit-content;
    margin: 0 auto;
}

.pagination-dots {
    display: flex;
    gap: 8px;
    align-items: center;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: var(--radius-full);
    background: var(--clr-gray);
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
}

.dot:hover {
    background: var(--clr-cyan);
    transform: scale(1.2);
}

.dot.active {
    background: linear-gradient(135deg, var(--clr-blue), var(--clr-blue-light));
    width: 32px;
    border-radius: var(--radius-full);
    box-shadow: 0 2px 8px rgba(3, 0, 131, 0.25);
}

.nav-buttons {
    display: flex;
    gap: 8px;
}

.nav-btn {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    background: var(--clr-white);
    color: var(--clr-blue);
    cursor: pointer;
    transition: var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
}

.nav-btn:hover:not(:disabled) {
    background: var(--clr-blue);
    color: var(--clr-white);
    border-color: var(--clr-blue);
    box-shadow: 0 4px 12px rgba(3, 0, 131, 0.2);
    transform: translateY(-1px);
}

.nav-btn:active:not(:disabled) {
    transform: translateY(0);
}

.nav-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    background: var(--clr-gray);
    border-color: var(--clr-gray);
    color: #999;
}

/* === LOADER === */
.loader {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--clr-gray);
    border-top-color: var(--clr-blue);
    border-right-color: var(--clr-cyan);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loader span {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* === EMPTY / ERROR STATES === */
.no-data-container,
.error-container {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 40px;
    background: var(--clr-white);
    border-radius: var(--radius-lg);
    border: 1px dashed var(--clr-gray);
}

.no-data-container i,
.error-container i {
    font-size: 3.5rem;
    margin-bottom: 20px;
    display: block;
}

.no-data-container i {
    color: var(--clr-gray);
}

.error-container i {
    color: var(--clr-orange);
}

.no-data-container h3 {
    color: var(--text-primary);
    font-size: 1.2rem;
    margin-bottom: 8px;
}

.error-container h3 {
    color: var(--clr-orange);
    font-size: 1.2rem;
    margin-bottom: 8px;
}

.no-data-container p,
.error-container p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* === ANIMATIONS === */
@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Staggered entrance for cards */
.client-card:nth-child(1) { animation-delay: 0s; }
.client-card:nth-child(2) { animation-delay: 0.08s; }
.client-card:nth-child(3) { animation-delay: 0.16s; }
.client-card:nth-child(4) { animation-delay: 0.24s; }
.client-card:nth-child(5) { animation-delay: 0.32s; }
.client-card:nth-child(6) { animation-delay: 0.40s; }

/* === RESPONSIVE === */
@media (max-width: 1024px) {
    .clients-grid {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
        gap: 24px;
    }

    .hero-section {
        padding: 80px 20px 60px;
    }

    .hero-stats {
        gap: 24px;
    }

    .hero-stat + .hero-stat {
        padding-left: 24px;
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }

    .hero-desc {
        font-size: 0.95rem;
    }

    .hero-stats {
        flex-direction: column;
        gap: 20px;
    }

    .hero-stat + .hero-stat {
        padding-left: 0;
        padding-top: 20px;
    }

    .hero-stat + .hero-stat::before {
        top: 0;
        left: 20%;
        right: 20%;
        width: 60%;
        height: 1px;
    }

    .container {
        padding: 40px 16px 60px;
    }
}

@media (max-width: 640px) {
    .clients-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .main-title {
        font-size: 1.7rem;
    }

    .card-header,
    .card-body,
    .card-footer {
        padding-left: 20px;
        padding-right: 20px;
    }

    .pagination-wrapper {
        flex-direction: column;
        gap: 16px;
        padding: 16px;
        width: 100%;
    }

    .hero-shape--1,
    .hero-shape--2,
    .hero-shape--3 {
        display: none;
    }

    .filter-tabs {
        gap: 6px;
    }

    .filter-tab {
        padding: 8px 16px;
        font-size: 0.78rem;
    }

    .hero-section {
        padding: 70px 16px 50px;
    }
}

@media (max-width: 400px) {
    .hero-title {
        font-size: 1.6rem;
    }

    .hero-stat__number {
        font-size: 1.6rem;
    }
}
