/* FreshPilled Protocol - Cyberpunk Terminal Aesthetic */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Courier New', 'Consolas', monospace;
    background: #000000;
    color: #00ff88;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Matrix Background */
#matrix-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.15;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    position: relative;
    z-index: 1;
}

/* App Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding: 20px;
    border: 2px solid #00ff88;
    background: rgba(0, 255, 136, 0.05);
}

.app-header h1 {
    font-size: 2em;
    letter-spacing: 3px;
}

.usage-indicator {
    font-size: 1em;
    text-transform: uppercase;
}

.usage-count {
    color: #00ffff;
    font-weight: bold;
}

/* Terminal Window */
.terminal-window {
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid #00ff88;
    margin-bottom: 30px;
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
}

.terminal-header {
    background: #00ff88;
    color: #000;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.9em;
}

.terminal-status {
    padding: 3px 10px;
    background: #000;
    color: #00ff88;
    border: 1px solid #00ff88;
}

.terminal-status.status-ok {
    color: #00ff88;
}

.terminal-status.status-warning {
    color: #ffff00;
    border-color: #ffff00;
}

.terminal-body {
    padding: 30px;
}

/* Terminal Prompt */
.terminal-prompt {
    color: #00ff88;
    margin-bottom: 20px;
    font-size: 1.1em;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ASCII Art */
.ascii-art {
    color: #00ff88;
    font-size: 0.7em;
    line-height: 1.2;
    margin: 20px 0;
    text-align: center;
    white-space: pre;
}

/* Boot Sequence */
.boot-sequence {
    margin: 20px 0;
    padding: 20px;
    background: rgba(0, 255, 136, 0.05);
    border-left: 3px solid #00ff88;
}

.boot-sequence p {
    margin: 8px 0;
    animation: typewriter 0.5s steps(40);
}

.status-ok {
    color: #00ff88;
}

/* Forms */
.login-form {
    max-width: 500px;
    margin: 30px auto;
}

.form-group {
    margin-bottom: 20px;
}

.terminal-label {
    display: block;
    margin-bottom: 10px;
    color: #00ff88;
    text-transform: uppercase;
    font-size: 0.9em;
}

.terminal-input {
    width: 100%;
    padding: 15px;
    background: rgba(0, 255, 136, 0.1);
    border: 2px solid #00ff88;
    color: #00ff88;
    font-family: 'Courier New', monospace;
    font-size: 1.1em;
    text-transform: uppercase;
    outline: none;
    transition: all 0.3s;
}

.terminal-input:focus {
    background: rgba(0, 255, 136, 0.15);
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.5);
}

.terminal-input::placeholder {
    color: rgba(0, 255, 136, 0.4);
}

/* Buttons */
.terminal-button {
    width: 100%;
    padding: 15px 30px;
    background: #00ff88;
    color: #000;
    border: none;
    font-family: 'Courier New', monospace;
    font-size: 1.1em;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.terminal-button:hover:not(:disabled) {
    background: #00ffff;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.6);
}

.terminal-button:disabled {
    background: #333;
    color: #666;
    cursor: not-allowed;
}

.terminal-button.secondary {
    background: transparent;
    color: #00ff88;
    border: 2px solid #00ff88;
}

.terminal-button.secondary:hover {
    background: rgba(0, 255, 136, 0.1);
}

/* Error Message */
.error-message {
    margin: 15px 0;
    padding: 10px;
    color: #ff0055;
    font-size: 0.9em;
    text-align: center;
}

/* Info Text */
.info-text {
    text-align: center;
    margin-top: 40px;
    opacity: 0.8;
}

/* Glitch Effect */
.glitch {
    position: relative;
    text-transform: uppercase;
    letter-spacing: 3px;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch::before {
    left: 2px;
    text-shadow: -2px 0 #ff00ff;
    clip: rect(24px, 550px, 90px, 0);
    animation: glitch-anim-1 3s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: -2px 0 #00ffff;
    clip: rect(85px, 550px, 140px, 0);
    animation: glitch-anim-2 2s infinite linear alternate-reverse;
}

@keyframes glitch-anim-1 {
    0% { clip: rect(92px, 9999px, 103px, 0); }
    10% { clip: rect(13px, 9999px, 125px, 0); }
    20% { clip: rect(81px, 9999px, 56px, 0); }
    30% { clip: rect(44px, 9999px, 98px, 0); }
    40% { clip: rect(119px, 9999px, 64px, 0); }
    50% { clip: rect(26px, 9999px, 137px, 0); }
    60% { clip: rect(83px, 9999px, 34px, 0); }
    70% { clip: rect(48px, 9999px, 109px, 0); }
    80% { clip: rect(67px, 9999px, 73px, 0); }
    90% { clip: rect(15px, 9999px, 95px, 0); }
    100% { clip: rect(54px, 9999px, 128px, 0); }
}

@keyframes glitch-anim-2 {
    0% { clip: rect(65px, 9999px, 103px, 0); }
    10% { clip: rect(128px, 9999px, 84px, 0); }
    20% { clip: rect(24px, 9999px, 91px, 0); }
    30% { clip: rect(107px, 9999px, 39px, 0); }
    40% { clip: rect(42px, 9999px, 117px, 0); }
    50% { clip: rect(88px, 9999px, 54px, 0); }
    60% { clip: rect(13px, 9999px, 101px, 0); }
    70% { clip: rect(76px, 9999px, 66px, 0); }
    80% { clip: rect(33px, 9999px, 124px, 0); }
    90% { clip: rect(97px, 9999px, 47px, 0); }
    100% { clip: rect(59px, 9999px, 112px, 0); }
}

/* Upload Area */
.upload-area {
    border: 3px dashed #00ff88;
    padding: 60px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: rgba(0, 255, 136, 0.05);
}

.upload-area:hover {
    background: rgba(0, 255, 136, 0.1);
    border-color: #00ffff;
}

.upload-icon {
    font-size: 4em;
    margin-bottom: 20px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.upload-hint {
    font-size: 0.9em;
    opacity: 0.6;
    margin-top: 10px;
}

/* Image Preview */
.image-preview {
    position: relative;
}

.image-preview img {
    max-width: 100%;
    max-height: 400px;
    display: block;
    margin: 0 auto 20px;
    border: 2px solid #00ff88;
}

.change-image-btn {
    padding: 10px 20px;
    background: transparent;
    color: #00ff88;
    border: 2px solid #00ff88;
    font-family: 'Courier New', monospace;
    cursor: pointer;
    transition: all 0.3s;
}

.change-image-btn:hover {
    background: rgba(0, 255, 136, 0.1);
}

/* Loading Analysis */
.loading-analysis {
    text-align: center;
    padding: 40px 20px;
}

.loading-bar {
    width: 100%;
    height: 30px;
    background: rgba(0, 255, 136, 0.1);
    border: 2px solid #00ff88;
    margin: 30px 0;
    overflow: hidden;
}

.loading-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg,
        transparent 0%,
        #00ff88 50%,
        transparent 100%
    );
    animation: loading-scan 2s infinite;
}

@keyframes loading-scan {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Recommendations */
.analysis-summary {
    padding: 20px;
    background: rgba(0, 255, 136, 0.1);
    border-left: 4px solid #00ff88;
    margin-bottom: 30px;
}

.analysis-summary p {
    margin: 10px 0;
    font-size: 1.1em;
}

.highlight {
    color: #00ffff;
    font-weight: bold;
}

.recommended-list {
    margin: 20px 0;
}

.recommendation-item {
    padding: 15px;
    margin: 10px 0;
    background: rgba(0, 255, 136, 0.05);
    border-left: 3px solid #00ffff;
}

.recommendation-item .name {
    color: #00ffff;
    font-weight: bold;
    font-size: 1.1em;
    margin-bottom: 5px;
}

.recommendation-item .reason {
    color: #00ff88;
    font-size: 0.95em;
    opacity: 0.9;
}

/* Selection Count */
.selection-count {
    text-align: center;
    font-size: 1.3em;
    margin: 20px 0;
    color: #00ffff;
}

/* Category Tabs */
.category-tabs {
    display: flex;
    gap: 10px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 10px 20px;
    background: transparent;
    color: #00ff88;
    border: 2px solid #00ff88;
    font-family: 'Courier New', monospace;
    cursor: pointer;
    transition: all 0.3s;
    flex: 1;
    min-width: 100px;
}

.tab-btn:hover {
    background: rgba(0, 255, 136, 0.1);
}

.tab-btn.active {
    background: #00ff88;
    color: #000;
}

/* Hairstyles Grid */
.hairstyles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.hairstyle-card {
    padding: 20px;
    background: rgba(0, 255, 136, 0.05);
    border: 2px solid #00ff88;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.hairstyle-card:hover {
    background: rgba(0, 255, 136, 0.1);
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.4);
}

.hairstyle-card.selected {
    background: rgba(0, 255, 136, 0.2);
    border-color: #00ffff;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
}

.hairstyle-card.recommended::before {
    content: "⭐ RECOMMENDED";
    position: absolute;
    top: -12px;
    left: 10px;
    background: #00ffff;
    color: #000;
    padding: 3px 10px;
    font-size: 0.7em;
    font-weight: bold;
}

.hairstyle-card .name {
    font-size: 1.2em;
    margin-bottom: 10px;
    color: #00ffff;
}

.hairstyle-card .category {
    font-size: 0.8em;
    opacity: 0.7;
    margin-bottom: 10px;
}

.hairstyle-card .description {
    font-size: 0.9em;
    line-height: 1.4;
    opacity: 0.9;
}

/* Generation Progress */
.generation-progress {
    text-align: center;
    padding: 40px 20px;
}

.progress-text {
    font-size: 1.5em;
    margin-bottom: 20px;
    color: #00ffff;
}

.progress-bar {
    width: 100%;
    height: 40px;
    background: rgba(0, 255, 136, 0.1);
    border: 2px solid #00ff88;
    margin: 30px 0;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #00ff88, #00ffff);
    transition: width 0.5s ease;
}

.current-hairstyle {
    font-size: 1.2em;
    margin-top: 20px;
    color: #00ff88;
}

/* Results Grid */
.results-container {
    margin: 30px 0;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.result-card {
    background: rgba(0, 255, 136, 0.05);
    border: 2px solid #00ff88;
    padding: 20px;
    transition: all 0.3s;
    cursor: pointer;
}

.result-card:hover {
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.5);
    transform: scale(1.02);
}

.result-card img {
    width: 100%;
    height: auto;
    display: block;
    margin-bottom: 15px;
    border: 1px solid #00ff88;
}

.result-card .name {
    font-size: 1.3em;
    color: #00ffff;
    margin-bottom: 10px;
}

.result-card .match-badge {
    display: inline-block;
    padding: 5px 15px;
    background: #00ff88;
    color: #000;
    font-weight: bold;
    margin-bottom: 10px;
}

.result-card .description {
    font-size: 0.9em;
    opacity: 0.8;
    line-height: 1.4;
}

/* Results Actions */
.results-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 30px;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: #000;
    border: 2px solid #00ff88;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    background: #00ff88;
    color: #000;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.3em;
}

.modal-close {
    background: none;
    border: none;
    color: #000;
    font-size: 2em;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
}

.modal-body {
    padding: 30px;
}

/* Responsive */
@media (max-width: 768px) {
    .app-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .app-header h1 {
        font-size: 1.5em;
    }

    .results-grid {
        grid-template-columns: 1fr;
    }

    .results-actions {
        grid-template-columns: 1fr;
    }

    .hairstyles-grid {
        grid-template-columns: 1fr;
    }

    .category-tabs {
        flex-direction: column;
    }

    .tab-btn {
        width: 100%;
    }
}

/* Typewriter Animation */
@keyframes typewriter {
    from { opacity: 0; }
    to { opacity: 1; }
}
