/* Hero Demo Animation Styles */

.app-demo-container {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.demo-frame {
    background: #FFFFFF;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    position: relative;
}

.demo-frame-header {
    background: linear-gradient(135deg, #F3E5F5 0%, #E1BEE7 100%);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid rgba(123, 31, 162, 0.1);
}

.demo-dots {
    display: flex;
    gap: 0.5rem;
}

.demo-dots .dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(123, 31, 162, 0.3);
}

.demo-url {
    flex: 1;
    text-align: center;
    font-size: 0.875rem;
    color: #7B1FA2;
    font-weight: 500;
}

.demo-screens {
    position: relative;
    min-height: 500px;
    background: #FAFAFA;
}

.demo-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 2rem;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.demo-screen.active {
    opacity: 1;
    transform: translateX(0);
    z-index: 1;
}

.demo-screen.exiting {
    opacity: 0;
    transform: translateX(-100%);
}

/* Screen Header */
.demo-screen-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.demo-screen-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
}

.demo-badge {
    padding: 0.375rem 0.875rem;
    background: linear-gradient(135deg, #7B1FA2 0%, #CE93D8 100%);
    color: white;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.demo-badge.success-badge {
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
}

/* Screen 1: Dashboard */
.demo-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.demo-stat {
    background: white;
    padding: 1.25rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    text-align: center;
}

.demo-stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #7B1FA2;
    margin-bottom: 0.5rem;
}

.demo-stat-label {
    font-size: 0.75rem;
    color: #666;
    font-weight: 500;
}

.demo-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    height: 150px;
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    gap: 1rem;
}

.demo-chart-bar {
    flex: 1;
    background: linear-gradient(180deg, #7B1FA2 0%, #CE93D8 100%);
    border-radius: 8px 8px 0 0;
    animation: barGrow 1s ease-out forwards;
    transform-origin: bottom;
}

@keyframes barGrow {
    from {
        transform: scaleY(0);
    }
    to {
        transform: scaleY(1);
    }
}

/* Screen 2: Analytics */
.demo-analytics {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.demo-metric-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.demo-metric-icon {
    font-size: 2.5rem;
}

.demo-metric-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #7B1FA2;
}

.demo-metric-label {
    font-size: 0.875rem;
    color: #666;
}

.demo-line-chart {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.demo-svg {
    width: 100%;
    height: auto;
}

.demo-svg polyline {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: drawLine 2s ease-out forwards;
}

@keyframes drawLine {
    to {
        stroke-dashoffset: 0;
    }
}

/* Screen 1: Customer Data Collection - Sequential Animation */
.demo-data-collection-sequence {
    position: relative;
    min-height: 400px;
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.demo-sequence-step {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

/* Step 1: QR Code Scan (0-2s) - Minimal Design */
.demo-qr-scan-step {
    animation: showStep1 6s ease-in-out infinite;
    text-align: center;
}

.qr-scan-container {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 0 auto 1.5rem;
}

.demo-qr-code-minimal {
    width: 200px;
    height: 200px;
    background: white;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

/* QR Corner Brackets */
.qr-corner {
    position: absolute;
    width: 40px;
    height: 40px;
    border: 3px solid #7B1FA2;
}

.qr-corner-tl {
    top: 15px;
    left: 15px;
    border-right: none;
    border-bottom: none;
    border-radius: 8px 0 0 0;
}

.qr-corner-tr {
    top: 15px;
    right: 15px;
    border-left: none;
    border-bottom: none;
    border-radius: 0 8px 0 0;
}

.qr-corner-bl {
    bottom: 15px;
    left: 15px;
    border-right: none;
    border-top: none;
    border-radius: 0 0 0 8px;
}

.qr-corner-br {
    bottom: 15px;
    right: 15px;
    border-left: none;
    border-top: none;
    border-radius: 0 0 8px 0;
}

/* QR Dots Pattern */
.qr-dots {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 20px;
}

.qr-dots span {
    width: 20px;
    height: 20px;
    background: #7B1FA2;
    border-radius: 4px;
    animation: qrDotPulse 1.5s ease-in-out infinite;
}

.qr-dots span:nth-child(1) { animation-delay: 0s; }
.qr-dots span:nth-child(2) { animation-delay: 0.1s; }
.qr-dots span:nth-child(3) { animation-delay: 0.2s; }
.qr-dots span:nth-child(4) { animation-delay: 0.3s; }
.qr-dots span:nth-child(5) { animation-delay: 0.4s; }
.qr-dots span:nth-child(6) { animation-delay: 0.5s; }
.qr-dots span:nth-child(7) { animation-delay: 0.6s; }
.qr-dots span:nth-child(8) { animation-delay: 0.7s; }
.qr-dots span:nth-child(9) { animation-delay: 0.8s; }

@keyframes qrDotPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.9); }
}

/* Scanning Line Animation */
.scan-line {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, #7B1FA2, transparent);
    animation: scanMove 2s ease-in-out infinite;
    box-shadow: 0 0 10px rgba(123, 31, 162, 0.5);
}

@keyframes scanMove {
    0% { top: 15px; opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { top: 185px; opacity: 0; }
}

.demo-qr-label {
    font-size: 0.9375rem;
    font-weight: 500;
    color: #666;
}

/* Step 2: Sign-up Form (2-4s) */
.demo-signup-step {
    animation: showStep2 6s ease-in-out infinite;
    display: flex;
    align-items: center;
    justify-content: center;
}

.demo-phone-mockup-large {
    width: 280px;
    margin: 0 auto;
    background: #1a1a1a;
    border-radius: 28px;
    padding: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

.phone-screen {
    background: white;
    border-radius: 20px;
    padding: 1.25rem;
    height: 380px;
    overflow: hidden;
}

.signup-form-mobile h4 {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 1.25rem;
    text-align: center;
}

.form-field {
    margin-bottom: 0.875rem;
}

.form-field label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #666;
    margin-bottom: 0.375rem;
}

.form-field input {
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 2px solid #E5E7EB;
    border-radius: 8px;
    font-size: 0.875rem;
    color: #1a1a1a;
    background: #F9FAFB;
    box-sizing: border-box;
}

.submit-btn {
    width: 100%;
    padding: 0.875rem;
    background: linear-gradient(135deg, #7B1FA2 0%, #CE93D8 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 0.9375rem;
    font-weight: 600;
    margin-top: 0.75rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(123, 31, 162, 0.3);
}

/* Step 3: Customer List Dashboard (4-6s) */
.demo-dashboard-step {
    animation: showStep3 6s ease-in-out infinite;
}

.demo-dashboard-view {
    background: #F9FAFB;
    border-radius: 12px;
    padding: 1.5rem;
    border: 2px solid #E5E7EB;
    max-width: 600px;
    margin: 0 auto;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #E5E7EB;
}

.dashboard-header h4 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
}

.customer-count {
    font-size: 0.875rem;
    color: #666;
    font-weight: 600;
}

.customer-table {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.customer-row {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    display: grid;
    grid-template-columns: 1.5fr 1.5fr 1fr 1fr;
    gap: 1rem;
    align-items: center;
    border: 1px solid #E5E7EB;
}

.customer-row.new-customer {
    border: 2px solid #7B1FA2;
    animation: highlightNew 1s ease-in-out;
}

.customer-name {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #1a1a1a;
}

.customer-phone {
    font-size: 0.875rem;
    color: #666;
}

.customer-status {
    font-size: 0.8125rem;
    color: #10b981;
    font-weight: 600;
}

.customer-date {
    font-size: 0.8125rem;
    color: #999;
}

@keyframes highlightNew {
    0%, 100% { background: white; }
    50% { background: #F3E5F5; }
}

/* Sequential Animation Keyframes */
@keyframes showStep1 {
    0%, 33% { opacity: 1; }
    35%, 100% { opacity: 0; }
}

@keyframes showStep2 {
    0%, 33% { opacity: 0; }
    35%, 66% { opacity: 1; }
    68%, 100% { opacity: 0; }
}

@keyframes showStep3 {
    0%, 66% { opacity: 0; }
    68%, 100% { opacity: 1; }
}

/* Screen 2: Create Campaign */
.demo-form {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.demo-input {
    margin-bottom: 1.5rem;
}

.demo-input-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
}

.demo-input-field {
    background: #F5F5F5;
    padding: 0.875rem 1rem;
    border-radius: 8px;
    font-size: 0.9375rem;
    color: #1a1a1a;
    border: 2px solid transparent;
}

.demo-textarea {
    min-height: 80px;
}

.typing-animation {
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid #7B1FA2;
    animation: typing 2s steps(25) forwards, blink 0.75s step-end infinite;
}

.typing-animation-2 {
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid #7B1FA2;
    animation: typing 2s steps(40) 0.5s forwards, blink 0.75s step-end infinite;
}

@keyframes typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink {
    from, to {
        border-color: transparent;
    }
    50% {
        border-color: #7B1FA2;
    }
}

.demo-button-group {
    margin-top: 2rem;
}

.demo-btn {
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.demo-btn-primary {
    background: linear-gradient(135deg, #7B1FA2 0%, #CE93D8 100%);
    color: white;
}

.pulse-animation {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 12px rgba(123, 31, 162, 0.3);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 8px 24px rgba(123, 31, 162, 0.4);
    }
}

.button-click-animation {
    animation: buttonClick 4s ease-in-out forwards;
}

@keyframes buttonClick {
    0%, 40% {
        transform: scale(1);
        box-shadow: 0 4px 12px rgba(123, 31, 162, 0.3);
    }
    45% {
        transform: scale(0.95);
        box-shadow: 0 2px 6px rgba(123, 31, 162, 0.4);
    }
    50% {
        transform: scale(1);
        box-shadow: 0 4px 12px rgba(123, 31, 162, 0.3);
    }
    55% {
        background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    }
    100% {
        background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
        transform: scale(1);
        box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    }
}

/* Screen 2: Customer SMS */
.demo-phone-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}

.demo-phone-frame {
    width: 300px;
    height: 500px;
    background: #1a1a1a;
    border-radius: 30px;
    padding: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
}

.demo-phone-notch {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 25px;
    background: #1a1a1a;
    border-radius: 0 0 20px 20px;
    z-index: 2;
}

.demo-phone-content {
    width: 100%;
    height: 100%;
    background: #f5f5f5;
    border-radius: 22px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.demo-sms-header {
    background: #f9fafb;
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.demo-sms-back {
    color: #7B1FA2;
    font-size: 1.125rem;
    font-weight: 500;
}

.demo-sms-contact {
    font-size: 1rem;
    font-weight: 600;
    color: #1a1a1a;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.demo-sms-messages {
    flex: 1;
    padding: 1.5rem 1rem;
    overflow-y: auto;
}

.demo-sms-bubble {
    background: #e5e7eb;
    padding: 0.875rem 1rem;
    border-radius: 18px;
    max-width: 85%;
    margin-bottom: 0.5rem;
}

.demo-sms-text {
    font-size: 0.9375rem;
    line-height: 1.5;
    color: #1a1a1a;
    margin-bottom: 0.375rem;
}

.demo-sms-time {
    font-size: 0.75rem;
    color: #6b7280;
}

.slide-in-animation {
    animation: slideIn 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    opacity: 0;
}

@keyframes slideIn {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Screen 4: QR Code */
.demo-qr-section {
    text-align: center;
}

.demo-qr-code {
    width: 200px;
    height: 200px;
    margin: 0 auto 1.5rem;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.demo-qr-inner {
    width: 160px;
    height: 160px;
    background: linear-gradient(135deg, #7B1FA2 0%, #CE93D8 100%);
    border-radius: 8px;
    display: block;
    position: relative;
}

.demo-qr-inner::before,
.demo-qr-inner::after {
    content: '';
    position: absolute;
    background: white;
    border-radius: 4px;
}

.demo-qr-inner::before {
    width: 40px;
    height: 40px;
    top: 20px;
    left: 20px;
}

.demo-qr-inner::after {
    width: 40px;
    height: 40px;
    bottom: 20px;
    right: 20px;
}

.pulse-qr {
    animation: pulseQR 2s ease-in-out infinite;
}

@keyframes pulseQR {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.demo-qr-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 0.5rem;
}

.demo-qr-subtitle {
    font-size: 1rem;
    color: #666;
    margin-bottom: 2rem;
}

.demo-phone-mockup {
    width: 200px;
    height: 120px;
    margin: 2rem auto 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    padding: 1rem;
}

.demo-signup-form {
    text-align: center;
}

.demo-checkmark {
    width: 60px;
    height: 60px;
    margin: 0 auto 0.75rem;
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    animation: checkmarkPop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes checkmarkPop {
    0% {
        transform: scale(0);
    }
    100% {
        transform: scale(1);
    }
}

.demo-success-text {
    font-size: 0.875rem;
    font-weight: 600;
    color: #10b981;
}

.fade-in-animation {
    animation: fadeInUp 0.8s ease-out forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Screen 5: Results */
.demo-results {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.demo-result-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    text-align: center;
}

.demo-result-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

.demo-result-value {
    font-size: 2rem;
    font-weight: 700;
    color: #7B1FA2;
    margin-bottom: 0.5rem;
}

.demo-result-label {
    font-size: 0.875rem;
    color: #666;
}

.counter-animation {
    animation: countUp 2s ease-out forwards;
}

.demo-progress-bar {
    background: #E0E0E0;
    height: 12px;
    border-radius: 6px;
    overflow: hidden;
}

.demo-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #7B1FA2 0%, #CE93D8 100%);
    border-radius: 6px;
    animation: progressFill 2s ease-out forwards;
}

@keyframes progressFill {
    from {
        width: 0%;
    }
    to {
        width: 89%;
    }
}

/* Progress Indicators */
.demo-indicators {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    padding: 1.5rem;
    background: white;
}

.demo-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #E0E0E0;
    transition: all 0.3s ease;
}

.demo-indicator.active {
    background: #7B1FA2;
    width: 30px;
    border-radius: 5px;
}

/* Animation Sequence */
.demo-screen-1.active { animation: fadeInScreen 0.6s ease-out; }
.demo-screen-2.active { animation: fadeInScreen 0.6s ease-out; }
.demo-screen-3.active { animation: fadeInScreen 0.6s ease-out; }
.demo-screen-4.active { animation: fadeInScreen 0.6s ease-out; }
.demo-screen-5.active { animation: fadeInScreen 0.6s ease-out; }

@keyframes fadeInScreen {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .demo-screens {
        min-height: 450px;
    }
    
    .demo-screen {
        padding: 1.5rem;
    }
    
    .demo-stats-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .demo-analytics {
        grid-template-columns: 1fr;
    }
    
    .demo-results {
        grid-template-columns: 1fr;
    }
    
    .demo-qr-code {
        width: 150px;
        height: 150px;
    }
    
    .demo-qr-inner {
        width: 120px;
        height: 120px;
    }
    
    .demo-phone-frame {
        width: 260px;
        height: 450px;
    }
    
    .demo-phone-container {
        min-height: 350px;
    }
    
    .demo-data-collection-sequence {
        padding: 1rem;
        min-height: 350px;
    }
    
    .qr-scan-container {
        width: 160px;
        height: 160px;
    }
    
    .demo-qr-code-minimal {
        width: 160px;
        height: 160px;
    }
    
    .qr-corner {
        width: 30px;
        height: 30px;
    }
    
    .qr-dots {
        gap: 8px;
        padding: 15px;
    }
    
    .qr-dots span {
        width: 16px;
        height: 16px;
    }
    
    .demo-phone-mockup-large {
        width: 240px;
    }
    
    .phone-screen {
        padding: 1rem;
        height: 320px;
    }
    
    .signup-form-mobile h4 {
        font-size: 1rem;
        margin-bottom: 1rem;
    }
    
    .form-field {
        margin-bottom: 0.75rem;
    }
    
    .form-field input {
        padding: 0.5rem 0.625rem;
        font-size: 0.8125rem;
    }
    
    .demo-dashboard-view {
        padding: 1rem;
    }
    
    .customer-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .customer-phone,
    .customer-date {
        font-size: 0.8125rem;
    }
}

