/* 
 * Tablix Demo Animation Styles
 * Contains all the styling for the animated demo in the hero section
 */

.hero-section {
    position: relative;
    overflow: hidden;
    padding: 5rem 0;
    background: linear-gradient(135deg, #f0f7ff 0%, #e5efff 100%);
    position: relative;
}

/* Modern animated background elements */
.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 80%;
    height: 200%;
    background: radial-gradient(circle, rgba(79, 70, 229, 0.03) 0%, rgba(79, 70, 229, 0.01) 50%, transparent 70%);
    transform: rotate(-20deg);
    z-index: 0;
    animation: pulse 15s infinite alternate ease-in-out;
}

.hero-section::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 60%;
    height: 150%;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.03) 0%, rgba(6, 182, 212, 0.01) 60%, transparent 75%);
    transform: rotate(15deg);
    z-index: 0;
    animation: pulse 12s 2s infinite alternate ease-in-out;
}

@keyframes pulse {
    0% { opacity: 0.4; transform: rotate(-20deg) scale(1); }
    100% { opacity: 1; transform: rotate(-15deg) scale(1.1); }
}

.hero-section .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 3rem;
    position: relative;
    z-index: 1;
}

.hero-content {
    flex-basis: 45%;
    text-align: left;
    padding-right: 2rem;
    z-index: 2;
    animation: fadeInUp 0.8s ease-out forwards;
}

.hero-title {
    font-size: 2.8rem;
    margin-bottom: 1.5rem;
    line-height: 1.2;
    background: linear-gradient(90deg, #1e293b 0%, #334155 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
}

.hero-subtitle {
    font-size: 1.125rem;
    margin-bottom: 2rem;
    line-height: 1.6;
    color: #475569;
    animation: fadeInUp 1s 0.2s ease-out forwards;
    opacity: 0;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-animation {
    flex-basis: 55%;
    position: relative;
    min-height: 400px;
    z-index: 1;
    animation: slideInRight 1s ease-out forwards;
    opacity: 0;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Animation container */
.tablix-demo-animation {
    position: relative;
    width: 100%;
    height: 450px;
    background-color: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.02);
    overflow: hidden;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 15px;
    padding: 18px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.tablix-demo-animation:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 60px rgba(79, 70, 229, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.02);
}

.tablix-demo-animation.pulse-effect {
    animation: containerPulse 0.5s ease-in-out;
}

@keyframes containerPulse {
    0% { box-shadow: 0 20px 50px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.02); }
    50% { box-shadow: 0 20px 70px rgba(79, 70, 229, 0.25), 0 0 0 1px rgba(79, 70, 229, 0.1); }
    100% { box-shadow: 0 20px 50px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.02); }
}

/* Demo steps common styles */
.demo-data-sheet,
.demo-query-input,
.demo-result-view,
.demo-chart-view {
    background-color: #fcfdff;
    border-radius: 12px;
    padding: 18px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.04), 0 0 0 1px rgba(0, 0, 0, 0.02);
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.6s cubic-bezier(0.215, 0.61, 0.355, 1), 
                transform 0.6s cubic-bezier(0.215, 0.61, 0.355, 1),
                box-shadow 0.3s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
}

.demo-data-sheet::after,
.demo-query-input::after,
.demo-result-view::after,
.demo-chart-view::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #4f46e5, #7c3aed);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.demo-data-sheet:hover,
.demo-query-input:hover,
.demo-result-view:hover,
.demo-chart-view:hover {
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.03);
}

.demo-data-sheet:hover::after,
.demo-query-input:hover::after,
.demo-result-view:hover::after,
.demo-chart-view:hover::after {
    opacity: 1;
}

.demo-data-sheet.active,
.demo-query-input.active,
.demo-result-view.active,
.demo-chart-view.active {
    opacity: 1;
    transform: translateY(0);
}

.demo-step-header {
    display: flex;
    align-items: center;
    margin-bottom: 14px;
    gap: 10px;
}

.demo-step-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    border-radius: 50%;
    font-size: 0.875rem;
    box-shadow: 0 3px 8px rgba(79, 70, 229, 0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.active .demo-step-icon {
    animation: pulseIcon 2s infinite;
}

@keyframes pulseIcon {
    0% { box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(79, 70, 229, 0); }
    100% { box-shadow: 0 0 0 0 rgba(79, 70, 229, 0); }
}

.demo-step-title {
    font-weight: 600;
    color: #1e293b;
    font-size: 1rem;
    transition: color 0.2s ease;
}

.active .demo-step-title {
    color: #4f46e5;
}

/* Data Sheet */
.demo-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.75rem;
    max-height: 180px;
    overflow-y: auto;
    border-radius: 6px;
    background: white;
    border: 1px solid rgba(226, 232, 240, 0.8);
}

.demo-table th {
    background: linear-gradient(to bottom, #f8fafc, #f1f5f9);
    padding: 8px 10px;
    text-align: left;
    font-weight: 600;
    color: #334155;
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 1px solid #e2e8f0;
    transition: background-color 0.2s ease;
    font-size: 0.8rem;
    letter-spacing: 0.02em;
}

.demo-table th:first-child {
    border-top-left-radius: 6px;
}

.demo-table th:last-child {
    border-top-right-radius: 6px;
}

.demo-table td {
    padding: 6px 10px;
    border-top: 1px solid #e2e8f0;
    color: #475569;
    transition: background-color 0.15s ease;
}

.demo-table tr:hover td {
    background-color: rgba(243, 244, 246, 0.7);
}

.demo-table tr:nth-child(even) {
    background-color: #f8fafc;
}

.demo-table tr:last-child td:first-child {
    border-bottom-left-radius: 6px;
}

.demo-table tr:last-child td:last-child {
    border-bottom-right-radius: 6px;
}

/* Query Input */
.demo-query-box {
    background-color: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 14px 18px;
    font-size: 0.95rem;
    color: #334155;
    position: relative;
    min-height: 50px;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02), 0 0 0 1px rgba(0, 0, 0, 0.01);
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.active .demo-query-box {
    border-color: rgba(79, 70, 229, 0.3);
    box-shadow: 0 3px 10px rgba(79, 70, 229, 0.08), 0 0 0 1px rgba(79, 70, 229, 0.1);
}

.demo-query-cursor {
    display: inline-block;
    margin-left: 2px;
    font-weight: bold;
    color: #4f46e5;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Results View */
.demo-results-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.8rem;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid rgba(226, 232, 240, 0.8);
}

.demo-results-table th {
    background: linear-gradient(to bottom, #f8fafc, #f1f5f9);
    padding: 10px;
    text-align: left;
    font-weight: 600;
    color: #334155;
    text-transform: capitalize;
    letter-spacing: 0.02em;
    border-bottom: 1px solid #e2e8f0;
}

.demo-results-table td {
    padding: 8px 10px;
    border-top: 1px solid #e2e8f0;
    color: #475569;
    transition: background-color 0.15s ease;
}

.demo-results-table tr:hover td {
    background-color: rgba(243, 244, 246, 0.7);
}

.demo-results-table tr:nth-child(even) td {
    background-color: #f8fafc;
}

.demo-results-table tr:last-child td:first-child {
    border-bottom-left-radius: 6px;
}

.demo-results-table tr:last-child td:last-child {
    border-bottom-right-radius: 6px;
}

/* Chart View */
.demo-chart-container {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0; /* allow container to shrink within grid */
    position: relative;
}

.demo-chart {
    flex-grow: 1;
    position: relative;
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow-y: auto;
}

.active .demo-chart {
    animation: chartPop 0.8s 0.2s forwards;
    transform-origin: center;
    opacity: 0;
}

@keyframes chartPop {
    0% { 
        opacity: 0;
        transform: scale(0.92);
    }
    70% {
        opacity: 1;
        transform: scale(1.03);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.demo-chart canvas {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.05));
}

.demo-chart-explanation {
    text-align: center;
    color: #64748b;
    font-size: 0.85rem;
    margin-top: 12px;
    font-style: italic;
    opacity: 0;
    transform: translateY(5px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.active .demo-chart-explanation {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.6s;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .hero-section .container {
        flex-direction: column;
    }
    
    .hero-content, 
    .hero-animation {
        flex-basis: 100%;
        max-width: 100%;
    }
    
    .hero-content {
        padding-right: 0;
        margin-bottom: 2.5rem;
    }
    
    .tablix-demo-animation {
        height: 600px;
        grid-template-columns: 1fr;
        grid-template-rows: repeat(4, 1fr);
        gap: 12px;
    }
    
    .hero-animation {
        animation: fadeInUp 1s ease-out forwards;
        transform: none;
    }
}

@media (max-width: 768px) {
    .hero-section {
        padding: 4rem 0;
    }
    
    .hero-title {
        font-size: 2.2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .tablix-demo-animation {
        height: 700px;
        box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
    }
    
    .demo-step-icon {
        width: 28px;
        height: 28px;
    }
}

@media (max-width: 480px) {
    .hero-section {
        padding: 3rem 0 2rem;
    }
    
    .hero-title {
        font-size: 1.8rem;
        margin-bottom: 1rem;
    }
    
    .tablix-demo-animation {
        height: 500px;
        grid-template-columns: 1fr;
        grid-template-rows: repeat(4, 1fr);
        gap: 8px;
        padding: 12px;
    }
    
    .demo-data-sheet,
    .demo-query-input,
    .demo-result-view,
    .demo-chart-view {
        padding: 12px;
    }
    
    .demo-step-icon {
        width: 24px;
        height: 24px;
        font-size: 0.75rem;
    }
    
    .demo-step-title {
        font-size: 0.85rem;
    }
    
    .hero-content {
        text-align: center;
        animation: fadeInUp 0.5s ease-out forwards;
        margin-bottom: 1.5rem;
    }
    
    .hero-section::before,
    .hero-section::after {
        opacity: 0.5;
    }
}
