/* Classical Ciphers Specific Styles */

:root {
    --cipher-primary: #2563eb;
    --cipher-secondary: #1d4ed8;
    --cipher-accent: #3b82f6;
    --cipher-gold: #f59e0b;
    --cipher-light: #f8fafc;
    --cipher-lighter: #ffffff;
    --cipher-dark: #1e293b;
    --cipher-darker: #0f172a;
    --cipher-text: #334155;
    --cipher-text-light: #64748b;
    --cipher-shadow: rgba(37, 99, 235, 0.15);
    --cipher-border: rgba(37, 99, 235, 0.2);
    --cipher-glow: rgba(37, 99, 235, 0.3);
}

/* Typography */
.app-title .title-main {
    font-family: 'Crimson Text', serif;
    font-weight: 700;
    color: var(--cipher-primary);
    text-shadow: 2px 2px 4px var(--cipher-shadow);
}

.app-title .title-subtitle {
    font-family: 'Crimson Text', serif;
    font-weight: 400;
    font-style: italic;
    color: var(--cipher-secondary);
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--cipher-lighter) 0%, var(--cipher-light) 50%, var(--cipher-lighter) 100%);
    position: relative;
    overflow: hidden;
    padding: 80px 0;
}

/* Override hero-content to remove card styling and center it */
.hero-section .hero-content {
    background: transparent;
    backdrop-filter: none;
    padding: 0;
    border-radius: 0;
    border: none;
    box-shadow: none;
    max-width: 1200px;
    margin: 0 auto;
    text-align: left;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 3rem;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.ancient-symbols {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.floating-symbol {
    position: absolute;
    font-size: 2rem;
    color: var(--cipher-accent);
    opacity: 0.05;
    animation: float 20s infinite linear;
    pointer-events: none;
}

@keyframes float {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.1;
    }
    90% {
        opacity: 0.1;
    }
    100% {
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}

.cipher-glow {
    background: radial-gradient(circle, var(--cipher-glow) 0%, transparent 70%);
    opacity: 0.8;
}

/* App Info Layout */
.hero-section .app-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
}

.hero-section .app-details {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.hero-section .app-title {
    text-align: left;
}

.hero-section .app-tagline {
    text-align: left;
}

.hero-section .app-description {
    text-align: left;
    max-width: 800px;
    margin: 0;
    width: 100%;
}

.hero-section .app-actions {
    display: flex;
    justify-content: flex-start;
    width: 100%;
    margin-top: 2rem;
}

/* App Icon */
.app-icon-large {
    position: relative;
    width: 90px;
    height: 90px;
    margin-bottom: 0;
}

.app-icon-large img {
    width: 100%;
    height: 100%;
    border-radius: 24px;
    box-shadow: 0 8px 32px var(--cipher-shadow);
}

/* Cipher Wheel */
.cipher-wheel {
    position: relative;
    width: 280px;
    height: 280px;
    margin: 0 auto;
}

.wheel-outer, .wheel-inner {
    position: absolute;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid var(--cipher-primary);
    background: var(--cipher-lighter);
    box-shadow: 0 8px 32px var(--cipher-shadow);
}

.wheel-outer {
    width: 280px;
    height: 280px;
    top: 0;
    left: 0;
    background: var(--cipher-lighter);
}

.wheel-inner {
    width: 180px;
    height: 180px;
    top: 50px;
    left: 50px;
    background: linear-gradient(45deg, var(--cipher-light), var(--cipher-lighter));
    animation: rotate 30s linear infinite;
}

.wheel-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: var(--cipher-primary);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    z-index: 10;
    box-shadow: 0 4px 16px var(--cipher-shadow);
}

.cipher-name {
    font-size: 0.7rem;
    margin-bottom: 2px;
}

.cipher-shift {
    font-size: 1rem;
    color: var(--cipher-accent);
}

.wheel-letters {
    position: absolute;
    width: 100%;
    height: 100%;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
    font-size: 0.8rem;
    color: var(--cipher-primary);
    letter-spacing: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: rotate(-90deg);
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Demo Section */
.demo-section {
    background: linear-gradient(to bottom, var(--cipher-lighter), var(--cipher-light));
    padding: 80px 0;
}

.cipher-selector {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.cipher-btn {
    padding: 12px 24px;
    border: 2px solid var(--cipher-border);
    background: var(--cipher-lighter);
    color: var(--cipher-primary);
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.cipher-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--cipher-glow), transparent);
    transition: left 0.5s;
}

.cipher-btn:hover::before {
    left: 100%;
}

.cipher-btn:hover {
    background: var(--cipher-primary);
    color: var(--cipher-lighter);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--cipher-shadow);
}

.cipher-btn.active {
    background: var(--cipher-primary);
    color: var(--cipher-lighter);
    box-shadow: 0 4px 12px var(--cipher-shadow);
}

.demo-input-section {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 2rem;
    align-items: start;
    margin-bottom: 2rem;
}

.demo-input, .demo-output {
    display: flex;
    flex-direction: column;
}

.demo-input label, .demo-output label {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    color: var(--cipher-primary);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.demo-input textarea, .demo-output textarea {
    padding: 1rem;
    border: 2px solid var(--cipher-border);
    border-radius: 8px;
    background: var(--cipher-lighter);
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
    color: var(--cipher-text);
    min-height: 120px;
    resize: vertical;
    transition: border-color 0.3s ease;
}

.demo-input textarea:focus {
    outline: none;
    border-color: var(--cipher-primary);
    box-shadow: 0 0 0 3px var(--cipher-glow);
}

.cipher-controls {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--cipher-lighter);
    border: 2px solid var(--cipher-border);
    border-radius: 12px;
    box-shadow: 0 4px 12px var(--cipher-shadow);
}

.control-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.control-group label {
    font-family: 'Crimson Text', serif;
    font-weight: 600;
    color: var(--cipher-primary);
    font-size: 0.9rem;
}

.control-group input[type="range"] {
    width: 120px;
    accent-color: var(--cipher-primary);
}

.control-group input[type="text"] {
    padding: 8px 12px;
    border: 1px solid var(--cipher-border);
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    text-align: center;
    text-transform: uppercase;
}

#shiftValue {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    color: var(--cipher-primary);
    font-size: 1.2rem;
}

.cipher-explanation {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    border: 2px solid var(--cipher-border);
    box-shadow: 0 4px 16px var(--cipher-shadow);
    max-width: 600px;
    margin: 0 auto;
}

.cipher-explanation h3 {
    font-family: 'Crimson Text', serif;
    font-weight: 700;
    color: var(--cipher-primary);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.cipher-explanation p {
    color: var(--cipher-text);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.historical-note {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--cipher-light);
    border-radius: 8px;
    border-left: 4px solid var(--cipher-gold);
}

.history-icon {
    font-size: 1.2rem;
}

/* Cipher Collection Section */
.cipher-collection-section {
    background: linear-gradient(135deg, var(--cipher-light) 0%, var(--cipher-lighter) 100%);
    padding: 80px 0;
}

.cipher-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.cipher-card {
    background: var(--cipher-lighter);
    padding: 1.5rem;
    border-radius: 12px;
    border: 2px solid var(--cipher-border);
    box-shadow: 0 4px 16px var(--cipher-shadow);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.cipher-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--cipher-primary), var(--cipher-accent), var(--cipher-secondary));
}

.cipher-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px var(--cipher-shadow);
    border-color: var(--cipher-primary);
}

.cipher-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.cipher-card h3 {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    color: var(--cipher-primary);
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

.cipher-period {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: var(--cipher-accent);
    font-weight: 600;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cipher-card p {
    color: var(--cipher-text);
    line-height: 1.5;
    font-size: 0.95rem;
}

/* Timeline Section */
.timeline-section {
    background: var(--cipher-darker);
    color: var(--cipher-lighter);
    padding: 80px 0;
    position: relative;
}

.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, var(--cipher-accent), var(--cipher-primary));
    transform: translateX(-50%);
}

.timeline-item {
    position: relative;
    margin: 3rem 0;
    display: flex;
    align-items: center;
}

.timeline-item:nth-child(odd) {
    flex-direction: row;
}

.timeline-item:nth-child(even) {
    flex-direction: row-reverse;
}

.timeline-date {
    width: 140px;
    text-align: center;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    color: var(--cipher-accent);
    font-size: 1rem;
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--cipher-darker);
    padding: 8px 16px;
    border-radius: 20px;
    border: 2px solid var(--cipher-accent);
}

.timeline-date::after {
    content: '';
    position: absolute;
    top: 50%;
    right: -25px;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    background: var(--cipher-accent);
    border-radius: 50%;
    border: 4px solid var(--cipher-darker);
    box-shadow: 0 0 0 3px var(--cipher-accent);
}

.timeline-item:nth-child(even) .timeline-date::after {
    right: auto;
    left: -25px;
}

.timeline-content {
    flex: 1;
    background: rgba(37, 99, 235, 0.1);
    padding: 1.5rem;
    border-radius: 12px;
    margin: 0 2rem;
    backdrop-filter: blur(10px);
    border: 1px solid var(--cipher-border);
}

.timeline-content h3 {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    color: var(--cipher-accent);
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

.timeline-content p {
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
}

/* Features Section */
.features-section {
    background: linear-gradient(to bottom, var(--cipher-lighter), var(--cipher-light));
}

.features-grid .feature-card {
    border: 2px solid var(--cipher-border);
    background: var(--cipher-lighter);
}

.features-grid .feature-card:hover {
    border-color: var(--cipher-primary);
    box-shadow: 0 8px 24px var(--cipher-shadow);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.features-grid .feature-card h3 {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    color: var(--cipher-primary);
}

/* Use Cases Section */
.use-cases-section {
    background: var(--cipher-light);
}

.use-cases-grid .use-case-card {
    background: var(--cipher-lighter);
    border: 2px solid var(--cipher-border);
}

.use-cases-grid .use-case-card:hover {
    border-color: var(--cipher-primary);
    box-shadow: 0 8px 24px var(--cipher-shadow);
}

.use-case-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.use-cases-grid .use-case-card h3 {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    color: var(--cipher-primary);
}

/* App Info Section */
.app-info-section {
    background: linear-gradient(135deg, var(--cipher-light) 0%, var(--cipher-lighter) 100%);
    padding: 80px 0;
}

.app-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.info-card {
    border: 2px solid var(--cipher-border);
    background: var(--cipher-lighter);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 16px var(--cipher-shadow);
    transition: all 0.3s ease;
}

.info-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px var(--cipher-shadow);
    border-color: var(--cipher-primary);
}

.info-card h3 {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    color: var(--cipher-primary);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.info-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.info-card li {
    padding: 0.5rem 0;
    color: var(--cipher-text);
    border-bottom: 1px solid rgba(37, 99, 235, 0.1);
    position: relative;
    padding-left: 1.5rem;
}

.info-card li:last-child {
    border-bottom: none;
}

.info-card li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--cipher-primary);
    font-weight: 600;
}

/* CTA Section */
.cta-section {
    background: linear-gradient(135deg, var(--cipher-primary) 0%, var(--cipher-secondary) 100%);
    position: relative;
    overflow: hidden;
    padding: 80px 0;
}

.cta-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.cta-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.cta-content h2 {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 2.5rem;
    color: var(--cipher-lighter);
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.cta-content p {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2.5rem;
    line-height: 1.6;
}

.cta-actions {
    margin-bottom: 2rem;
}

.cta-features {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.cta-features span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--cipher-lighter);
    font-weight: 500;
    font-size: 0.95rem;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.cta-features span:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* App Store Button Styling */
.app-store-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: var(--cipher-darker);
    border: 2px solid var(--cipher-darker);
    color: var(--cipher-lighter);
    text-decoration: none;
    border-radius: 10px;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.3);
    position: relative;
    overflow: hidden;
    width: auto;
}

.app-store-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.app-store-btn:hover::before {
    left: 100%;
}

.app-store-btn:hover {
    background: #1e293b;
    border-color: var(--cipher-primary);
    transform: translateY(-3px);
    box-shadow: 0 8px 32px rgba(37, 99, 235, 0.4);
}

.app-store-btn .btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.app-store-btn .btn-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.2;
}

.app-store-btn .btn-subtitle {
    font-size: 0.7rem;
    font-weight: 400;
    opacity: 0.8;
    margin-bottom: 1px;
}

.app-store-btn .btn-title {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -0.025em;
}

.app-store-btn.large {
    padding: 16px 24px;
    font-size: 1rem;
}

.app-store-btn.large .btn-icon svg {
    width: 28px;
    height: 28px;
}

.app-store-btn.large .btn-subtitle {
    font-size: 0.75rem;
}

.app-store-btn.large .btn-title {
    font-size: 1.1rem;
}

/* CTA Section App Store Button Override */
.cta-section .app-store-btn {
    background: var(--cipher-lighter);
    border-color: var(--cipher-lighter);
    color: var(--cipher-primary);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.cta-section .app-store-btn:hover {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(255, 255, 255, 0.95);
    color: var(--cipher-primary);
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section .hero-content {
        flex-direction: column;
        gap: 2rem;
    }
    
    .hero-section .app-description {
        text-align: left;
        max-width: 100%;
    }
    
    .hero-section .app-actions {
        justify-content: center;
    }
    
    .app-icon-large {
        width: 100px;
        height: 100px;
        margin-bottom: 1rem;
    }
    
    .cipher-wheel {
        width: 220px;
        height: 220px;
    }
    
    .wheel-outer {
        width: 220px;
        height: 220px;
    }
    
    .wheel-inner {
        width: 150px;
        height: 150px;
        top: 35px;
        left: 35px;
    }
    
    .wheel-center {
        width: 70px;
        height: 70px;
    }
    
    .cipher-name {
        font-size: 0.6rem;
    }
    
    .cipher-shift {
        font-size: 0.9rem;
    }
    
    .demo-input-section {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .cipher-selector {
        gap: 0.5rem;
    }
    
    .cipher-btn {
        padding: 10px 16px;
        font-size: 0.9rem;
    }
    
    .timeline::before {
        left: 70px;
    }
    
    .timeline-item {
        flex-direction: row !important;
        padding-left: 140px;
        margin: 2rem 0;
    }
    
    .timeline-date {
        position: absolute;
        left: 0;
        width: 120px;
        font-size: 0.9rem;
        padding: 6px 12px;
    }
    
    .timeline-date::after {
        right: -25px !important;
        left: auto !important;
    }
    
    .timeline-content {
        margin-left: 0;
        margin-right: 0;
    }
}

@media (max-width: 480px) {
    .app-icon-large {
        width: 80px;
        height: 80px;
        margin-bottom: 1rem;
    }
    
    .cipher-wheel {
        width: 180px;
        height: 180px;
    }
    
    .wheel-outer {
        width: 180px;
        height: 180px;
    }
    
    .wheel-inner {
        width: 120px;
        height: 120px;
        top: 30px;
        left: 30px;
    }
    
    .wheel-center {
        width: 60px;
        height: 60px;
    }
    
    .cipher-name {
        font-size: 0.5rem;
    }
    
    .cipher-shift {
        font-size: 0.8rem;
    }
    
    .floating-symbol {
        font-size: 1.5rem;
    }
    
    .app-store-btn {
        padding: 12px 20px;
        gap: 10px;
    }
    
    .app-store-btn .btn-subtitle {
        font-size: 0.7rem;
    }
    
    .app-store-btn .btn-title {
        font-size: 1rem;
    }
    
    .timeline-item {
        padding-left: 100px;
    }
    
    .timeline-date {
        width: 80px;
        font-size: 0.8rem;
        padding: 4px 8px;
    }
    
    .cta-content h2 {
        font-size: 2rem;
    }
    
    .cta-content p {
        font-size: 1.1rem;
    }
    
    .cta-features {
        gap: 1rem;
    }
    
    .cta-features span {
        font-size: 0.85rem;
        padding: 6px 12px;
    }
}

@media (max-width: 640px) {
    .cta-content h2 {
        font-size: 1.75rem;
    }
    
    .cta-content p {
        font-size: 1rem;
        margin-bottom: 2rem;
    }
    
    .cta-features {
        gap: 0.75rem;
    }
    
    .cta-features span {
        font-size: 0.8rem;
        padding: 5px 10px;
    }
}
