/* 100X Solutions Brand System */
:root {
    --bg-primary: #0F172A;
    --surface-dark: #111827;
    --text-primary: #FFFFFF;
    --accent-cyan: #22D3EE;
    --accent-blue: #38BDF8;
    --success-green: #22C55E;
    --warning-orange: #F59E0B;
    --error-red: #EF4444;
    --border-color: #374151;
    --shadow-color: rgba(0, 0, 0, 0.3);
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    font-weight: 300;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background-color: var(--surface-dark);
    border-bottom: 1px solid var(--border-color);
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.brand {
    color: var(--accent-cyan);
    font-size: 0.9rem;
    font-weight: 400;
}

/* Main Content */
.main {
    padding: 40px 0;
    min-height: calc(100vh - 160px);
}

/* Sections */
.input-panel,
.title-input-panel,
.results-panel {
    background-color: var(--surface-dark);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px var(--shadow-color);
}

.section-header {
    text-align: center;
    margin-bottom: 30px;
}

.section-header h2 {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.section-header p {
    color: #9CA3AF;
    font-size: 1rem;
}

/* Input Grid */
.input-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

/* Input Groups */
.input-group {
    position: relative;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
}

.input-group input,
.input-group textarea,
.input-group select {
    width: 100%;
    padding: 12px 16px;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.input-group input:focus,
.input-group textarea:focus,
.input-group select:focus {
    outline: none;
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.1);
}

.input-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Tooltips */
.tooltip {
    position: absolute;
    right: 12px;
    top: 32px;
    width: 20px;
    height: 20px;
    background-color: var(--accent-cyan);
    color: var(--bg-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    cursor: help;
    transition: all 0.3s ease;
}

.tooltip:hover {
    transform: scale(1.1);
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.2);
}

/* Title Inputs */
.title-inputs {
    display: grid;
    gap: 20px;
    margin-bottom: 30px;
}

.title-input-group {
    position: relative;
}

.title-input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.title-input-group input {
    width: 100%;
    padding: 12px 16px;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 16px;
    transition: all 0.3s ease;
}

.title-input-group input:focus {
    outline: none;
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.1);
}

.char-count {
    position: absolute;
    right: 12px;
    bottom: 8px;
    font-size: 12px;
    color: #9CA3AF;
    font-weight: 400;
}

.char-count.warning {
    color: var(--warning-orange);
}

.char-count.danger {
    color: var(--error-red);
}

/* Buttons */
.btn-primary,
.btn-secondary {
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
    color: var(--bg-primary);
    box-shadow: 0 4px 15px rgba(34, 211, 238, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(34, 211, 238, 0.4);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 4px 15px rgba(34, 211, 238, 0.2);
}

.btn-secondary {
    background-color: transparent;
    color: var(--accent-cyan);
    border: 1px solid var(--accent-cyan);
}

.btn-secondary:hover {
    background-color: var(--accent-cyan);
    color: var(--bg-primary);
    transform: translateY(-1px);
}

.analyze-button-container {
    text-align: center;
    margin-top: 30px;
}

/* Winner Announcement */
.winner-announcement {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(34, 211, 238, 0.1));
    border: 2px solid var(--success-green);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 15px;
    animation: winnerGlow 2s ease-in-out infinite alternate;
}

@keyframes winnerGlow {
    0% { box-shadow: 0 0 20px rgba(34, 197, 94, 0.3); }
    100% { box-shadow: 0 0 30px rgba(34, 197, 94, 0.5); }
}

.winner-icon {
    font-size: 2rem;
}

.winner-text h3 {
    color: var(--success-green);
    font-size: 1.2rem;
    margin-bottom: 5px;
}

.winner-text p {
    font-size: 1.1rem;
    font-weight: 500;
}

/* Comparison Grid */
.comparison-grid {
    display: grid;
    gap: 20px;
    margin-bottom: 30px;
}

.title-card {
    background-color: var(--bg-primary);
    border-radius: 12px;
    padding: 20px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    position: relative;
}

.title-card:hover {
    border-color: var(--accent-cyan);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(34, 211, 238, 0.2);
}

.title-card.winner {
    border-color: var(--success-green);
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.05), rgba(34, 211, 238, 0.05));
}

.title-rank {
    position: absolute;
    top: -10px;
    right: 20px;
    background-color: var(--success-green);
    color: var(--bg-primary);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.title-content {
    margin-bottom: 20px;
}

.title-text {
    font-size: 1.1rem;
    font-weight: 500;
    line-height: 1.4;
    margin-bottom: 10px;
}

.title-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge.best-overall {
    background-color: var(--success-green);
    color: var(--bg-primary);
}

.badge.best-search {
    background-color: var(--accent-cyan);
    color: var(--bg-primary);
}

.badge.best-browse {
    background-color: var(--accent-blue);
    color: var(--bg-primary);
}

/* Score Display */
.score-display {
    margin-bottom: 20px;
}

.final-score {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.score-number {
    font-size: 1.5rem;
    font-weight: 700;
}

.score-label {
    font-size: 0.9rem;
    color: #9CA3AF;
}

.score-bar {
    height: 8px;
    background-color: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 5px;
}

.score-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.8s ease;
    background: linear-gradient(90deg, var(--accent-cyan), var(--success-green));
}

.score-fill.excellent {
    background: linear-gradient(90deg, var(--success-green), #10B981);
}

.score-fill.good {
    background: linear-gradient(90deg, var(--accent-cyan), var(--accent-blue));
}

.score-fill.average {
    background: linear-gradient(90deg, var(--warning-orange), #F97316);
}

.score-fill.poor {
    background: linear-gradient(90deg, var(--error-red), #DC2626);
}

.score-detail {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.score-item {
    text-align: center;
}

.score-item-label {
    font-size: 0.8rem;
    color: #9CA3AF;
    margin-bottom: 5px;
}

.score-item-value {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--accent-cyan);
}

/* Strengths and Weaknesses */
.analysis-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.strengths,
.weaknesses {
    background-color: var(--surface-dark);
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid var(--success-green);
}

.weaknesses {
    border-left-color: var(--error-red);
}

.strengths h4,
.weaknesses h4 {
    font-size: 1rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.strengths h4 {
    color: var(--success-green);
}

.weaknesses h4 {
    color: var(--error-red);
}

.strengths ul,
.weaknesses ul {
    list-style: none;
}

.strengths li,
.weaknesses li {
    padding: 4px 0;
    padding-left: 20px;
    position: relative;
    font-size: 0.9rem;
}

.strengths li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--success-green);
    font-weight: 600;
}

.weaknesses li:before {
    content: "⚠";
    position: absolute;
    left: 0;
    color: var(--error-red);
}

/* Insights Panel */
.insights-panel {
    background-color: var(--surface-dark);
    border-radius: 12px;
    padding: 25px;
    border-left: 4px solid var(--accent-cyan);
}

.insights-panel h3 {
    color: var(--accent-cyan);
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.insights-content {
    color: #E5E7EB;
    line-height: 1.6;
}

.insights-content strong {
    color: var(--accent-cyan);
}

/* Footer */
.footer {
    background-color: var(--surface-dark);
    border-top: 1px solid var(--border-color);
    padding: 20px 0;
    margin-top: 40px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-links a {
    color: #9CA3AF;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--accent-cyan);
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: var(--surface-dark);
    margin: 5% auto;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    position: relative;
    border: 1px solid var(--border-color);
}

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #9CA3AF;
    transition: color 0.3s ease;
}

.close:hover {
    color: var(--accent-cyan);
}

.modal h2 {
    margin-bottom: 20px;
    color: var(--accent-cyan);
}

.modal p {
    margin-bottom: 15px;
    line-height: 1.6;
}

.modal ul {
    margin: 15px 0;
    padding-left: 20px;
}

.modal li {
    margin-bottom: 8px;
    color: #E5E7EB;
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(34, 211, 238, 0.3);
    border-radius: 50%;
    border-top-color: var(--accent-cyan);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .input-grid {
        grid-template-columns: 1fr;
    }
    
    .comparison-grid {
        grid-template-columns: 1fr;
    }
    
    .analysis-details {
        grid-template-columns: 1fr;
    }
    
    .score-detail {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .winner-announcement {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .footer-links {
        justify-content: center;
    }
    
    .modal-content {
        margin: 10% auto;
        width: 95%;
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .input-panel,
    .title-input-panel,
    .results-panel {
        padding: 20px;
    }
    
    .section-header h2 {
        font-size: 1.5rem;
    }
    
    .score-detail {
        grid-template-columns: 1fr;
    }
    
    .btn-primary,
    .btn-secondary {
        width: 100%;
        justify-content: center;
    }
}

/* Animation for score bars */
.score-bar .score-fill {
    width: 0%;
    transition: width 1s ease;
}

.score-bar.animate .score-fill {
    animation: scoreBarFill 1.5s ease forwards;
}

@keyframes scoreBarFill {
    to {
        width: var(--score-width);
    }
}

/* Smooth scroll */
html {
    scroll-behavior: smooth;
}

/* Focus visible for accessibility */
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid var(--accent-cyan);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --border-color: #FFFFFF;
        --shadow-color: rgba(255, 255, 255, 0.2);
    }
}
