/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden;
}

:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.8);
    --text-muted: rgba(255, 255, 255, 0.6);
    --shadow-soft: 0 8px 32px rgba(31, 38, 135, 0.37);
    --shadow-glow: 0 0 20px rgba(102, 126, 234, 0.4);
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--primary-gradient);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Background animation */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(255, 219, 98, 0.2) 0%, transparent 50%);
    animation: float 20s ease-in-out infinite;
    z-index: -1;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(30px, -30px) rotate(120deg); }
    66% { transform: translate(-20px, 20px) rotate(240deg); }
}

/* Mirror phrase styling */
.mirror-phrase {
    text-align: center;
    margin-top: 16px;
    color: var(--text-secondary);
    font-size: 14px;
    font-style: italic;
    opacity: 0.8;
}

/* Demo mention styling */
.demo-mention {
    text-align: center;
    margin-bottom: 24px;
    padding: 12px 16px;
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.2);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 13px;
    font-style: italic;
    backdrop-filter: blur(5px);
}

/* HYVYS Cube Logo */
.logo-container {
    text-align: center;
    margin-bottom: 16px;
}

.hyvys-cube {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    border-radius: 12px;
    margin: 0 auto;
    position: relative;
    box-shadow: 
        0 4px 20px rgba(102, 126, 234, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1);
    opacity: 0.9;
    transition: var(--transition-smooth);
    transform-style: preserve-3d;
}

.hyvys-cube::before {
    content: '';
    position: absolute;
    top: 15%;
    left: 15%;
    right: 15%;
    bottom: 15%;
    background: linear-gradient(45deg, 
        rgba(255, 255, 255, 0.1) 0%,
        rgba(255, 255, 255, 0.05) 50%,
        rgba(255, 255, 255, 0.1) 100%);
    border-radius: 8px;
    backdrop-filter: blur(2px);
}

.hyvys-cube::after {
    content: '';
    position: absolute;
    top: 25%;
    left: 25%;
    right: 25%;
    bottom: 25%;
    background: linear-gradient(135deg, 
        rgba(118, 75, 162, 0.3) 0%,
        rgba(102, 126, 234, 0.2) 50%,
        rgba(118, 75, 162, 0.3) 100%);
    border-radius: 6px;
    transform: translateZ(10px);
}

.hyvys-cube:hover {
    opacity: 1;
    transform: translateY(-2px);
    box-shadow: 
        0 8px 30px rgba(102, 126, 234, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        inset 0 -1px 0 rgba(0, 0, 0, 0.15);
}

/* Header styling */
.header {
    text-align: center;
    padding: 40px 20px 32px;
    background: var(--glass-bg);
    border-bottom: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
}

/* Steps visual styling */
.steps-visual {
    display: flex;
    justify-content: space-between;
    margin-bottom: 24px;
    padding: 16px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    gap: 8px;
}

.step {
    flex: 1;
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    padding: 8px 4px;
    border-radius: 8px;
    transition: var(--transition-smooth);
    white-space: nowrap;
}

.step.active {
    background: rgba(102, 126, 234, 0.1);
    color: var(--text-primary);
    font-weight: 500;
}

/* Micro validation styling */
.micro-validation {
    margin-top: 8px;
    padding: 8px 12px;
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 13px;
    text-align: center;
    backdrop-filter: blur(10px);
}

.micro-validation.hidden {
    display: none;
}

/* Result intro styling */
.result-intro {
    text-align: center;
    margin-bottom: 32px;
    padding: 20px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.result-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

/* Own analysis button styling */
.own-analysis-btn {
    margin-top: 12px;
    width: 100%;
    padding: 12px 20px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    backdrop-filter: blur(10px);
}

.own-analysis-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.own-analysis-btn:active {
    transform: translateY(0);
}

/* Premium explanation styling */
.premium-explanation {
    text-align: center;
    margin: 16px 0;
    padding: 12px;
    background: rgba(102, 126, 234, 0.05);
    border: 1px solid rgba(102, 126, 234, 0.1);
    border-radius: 8px;
    backdrop-filter: blur(5px);
}

.premium-text {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
    opacity: 0.9;
    font-weight: 400;
}

/* Micro reward styling */
.micro-reward {
    text-align: center;
    margin-bottom: 16px;
    color: var(--text-secondary);
    font-size: 14px;
    font-style: italic;
}

/* Micro guide styling */
.micro-guide {
    text-align: center;
    margin-bottom: 32px;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
    padding: 16px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

/* Input labels alignment */
.input-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    text-align: left;
}

/* Name input styling */
.name-input {
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 8px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    backdrop-filter: blur(10px);
    transition: var(--transition-smooth);
}

.name-input::placeholder {
    color: var(--text-muted);
}

.name-input:focus {
    outline: none;
    border-color: rgba(102, 126, 234, 0.6);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Premium section styling */
.premium-section {
    padding: 20px;
}

.premium-header {
    text-align: center;
    margin-bottom: 32px;
    padding: 24px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.premium-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 8px 0;
}

.premium-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
    opacity: 0.8;
}

/* Deep analysis button styling */
.deep-analysis-btn {
    margin-top: 12px;
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    backdrop-filter: blur(10px);
    opacity: 0;
    animation: fadeIn 0.5s ease-in-out forwards;
}

.deep-analysis-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.deep-analysis-btn:active {
    transform: translateY(0);
}

/* Share button styling */
.share-btn {
    margin-top: 12px;
    width: 100%;
    padding: 12px 20px;
    background: var(--primary-gradient);
    border: none;
    border-radius: 12px;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.share-btn:active {
    transform: translateY(0);
}

/* Copy phrase button */
.copy-phrase-btn {
    margin-top: 12px;
    width: 100%;
    padding: 12px 20px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: var(--transition-smooth);
}

.copy-phrase-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.copy-phrase-btn:active {
    transform: translateY(0);
}

/* Demo toggle styling */
.demo-toggle {
    font-size: 12px;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.demo-toggle:hover {
    opacity: 1;
}

/* Container */
.container {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 1rem;
}

/* Header */
.header {
    text-align: center;
    padding: 2rem 1rem 3rem;
    animation: fadeInDown 0.8s ease-out;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.title {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #ffffff 0%, rgba(255, 255, 255, 0.8) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 400;
}

/* Main content */
.main {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 0 1rem 2rem;
}

/* Glassmorphism card */
.card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-soft);
    padding: 2rem;
    width: 100%;
    max-width: 600px;
    animation: fadeInUp 0.8s ease-out 0.2s both;
    transition: var(--transition-smooth);
}

.card:hover {
    box-shadow: var(--shadow-soft), var(--shadow-glow);
    transform: translateY(-2px);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Input section */
.input-section {
    margin-bottom: 2rem;
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.input-textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1rem;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    min-height: 100px;
    transition: var(--transition-smooth);
}

.input-textarea::placeholder {
    color: var(--text-muted);
}

.input-textarea:focus {
    outline: none;
    border-color: rgba(102, 126, 234, 0.5);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Buttons */
.button-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.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:active::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    flex: 1;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

/* Button loader */
.btn-loader {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.btn.loading .btn-text {
    display: none;
}

.btn.loading .btn-loader {
    display: block;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Output section */
.output-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.output-section.hidden {
    display: none;
}

.output-group {
    margin-bottom: 1.5rem;
    opacity: 0;
    animation: fadeIn 0.5s ease-out forwards;
}

.output-group:nth-child(1) { animation-delay: 0.1s; }
.output-group:nth-child(2) { animation-delay: 0.2s; }
.output-group:nth-child(3) { animation-delay: 0.3s; }
.output-group:nth-child(4) { animation-delay: 0.4s; }

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

.output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.output-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.copy-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
}

.copy-btn.copied {
    background: rgba(102, 126, 234, 0.3);
    color: var(--text-primary);
}

.output-text {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1rem;
    color: var(--text-secondary);
    line-height: 1.6;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.neutral-sentence {
    background: rgba(102, 126, 234, 0.1);
    border-color: rgba(102, 126, 234, 0.3);
    font-weight: 500;
    color: var(--text-primary);
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem 1rem;
    animation: fadeIn 0.8s ease-out 0.4s both;
}

.mentions-section {
    padding: 32px;
}

.mentions-content {
    max-width: 600px;
    margin: 0 auto;
}

.mentions-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 32px 0;
    text-align: center;
}

.mentions-item {
    margin-bottom: 24px;
    padding: 20px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.mentions-item h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 8px 0;
}

.mentions-item p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

.back-link {
    text-align: center;
    margin-top: 32px;
}

.footer {
    text-align: center;
    padding: 32px 20px;
    margin-top: 48px;
    border-top: 1px solid var(--glass-border);
}

.footer-legal {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-text,
.footer-contact,
.footer-mentions {
    font-size: 12px;
    color: var(--text-muted);
    margin: 4px 0;
    opacity: 0.7;
}

.footer-link {
    color: var(--text-muted);
    text-decoration: none;
    opacity: 0.8;
    transition: var(--transition-smooth);
}

.footer-link:hover {
    opacity: 1;
    color: var(--text-secondary);
}

.disclaimer {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 16px;
    opacity: 0.7;
}

.demo-toggle {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition-smooth);
    backdrop-filter: blur(10px);
}

.demo-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
}

.demo-toggle.active {
    background: rgba(102, 126, 234, 0.2);
    color: var(--text-primary);
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 16px;
    }
    
    .title {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .logo-container {
        margin-bottom: 12px;
    }
    
    .hyvys-cube {
        width: 50px;
        height: 50px;
    }
    
    .steps-visual {
        flex-direction: column;
        gap: 8px;
    }
    
    .step {
        font-size: 11px;
        padding: 6px 8px;
    }
}

@media (min-width: 768px) {
    .container {
        max-width: 800px;
        padding: 0 20px;
    }
    
    .title {
        font-size: 3rem;
    }
    
    .subtitle {
        font-size: 1.2rem;
    }
    
    .hyvys-cube {
        width: 60px;
        height: 60px;
    }
    
    .card {
        padding: 2.5rem;
    }
    
    .container {
        padding: 2rem;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 2rem;
    }
    
    .card {
        padding: 1.5rem;
        border-radius: 16px;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .output-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .copy-btn {
        align-self: flex-end;
    }
}

/* Validation styles */
.input-textarea.error {
    border-color: rgba(245, 87, 108, 0.5);
    box-shadow: 0 0 0 3px rgba(245, 87, 108, 0.1);
}

.error-message {
    color: rgba(245, 87, 108, 0.9);
    font-size: 0.85rem;
    margin-top: 0.25rem;
    display: none;
}

.error-message.show {
    display: block;
}
