/* CSS Naming Convention Validator - Styles */

:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --transition: all 0.2s ease;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header Styles */
.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #8b5cf6 100%);
    color: white;
    padding: 2rem 1rem;
    text-align: center;
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.logo {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
}

.header h1 {
    font-size: 1.75rem;
    font-weight: 700;
}

.subtitle {
    opacity: 0.9;
    font-size: 1rem;
    margin-top: 0.5rem;
}

/* Main Content */
.main-content {
    flex: 1;
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Input Section */
.input-section {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
}

.convention-selector {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.convention-selector label {
    font-weight: 600;
    color: var(--text-primary);
}

.convention-selector select {
    flex: 1;
    min-width: 200px;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    background: white;
    cursor: pointer;
    transition: var(--transition);
}

.convention-selector select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.info-btn {
    background: transparent;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    font-size: 1.25rem;
    transition: var(--transition);
}

.info-btn:hover {
    background: var(--bg-color);
    border-color: var(--primary-color);
}

/* Convention Info Panel */
.convention-info {
    display: none;
    background: var(--bg-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 1rem;
    border-left: 4px solid var(--primary-color);
}

.convention-info.visible {
    display: block;
}

.convention-info h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.convention-info p {
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.info-examples {
    background: white;
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.875rem;
}

.info-examples .valid-example {
    color: var(--success-color);
}

.info-examples .invalid-example {
    color: var(--error-color);
}

/* Input Container */
.input-container {
    margin-bottom: 1rem;
}

.input-container label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

#css-input {
    width: 100%;
    min-height: 200px;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
    resize: vertical;
    transition: var(--transition);
    line-height: 1.5;
}

#css-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

#css-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

/* Button Group */
.button-group {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

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

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-color);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Results Section */
.results-section {
    display: none;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
}

.results-section.visible {
    display: block;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.results-header h2 {
    font-size: 1.25rem;
    color: var(--text-primary);
}

.results-summary {
    display: flex;
    gap: 1rem;
}

.summary-item {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.875rem;
}

.summary-valid {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.summary-invalid {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error-color);
}

/* Results Tabs */
.results-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.tab-btn {
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.tab-btn:hover {
    color: var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
}

.tab-btn.active {
    color: var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
}

/* Results List */
.results-list {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 1.5rem;
}

.result-item {
    display: flex;
    align-items: flex-start;
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
    gap: 0.75rem;
}

.result-item.valid {
    background: rgba(16, 185, 129, 0.05);
    border-left: 3px solid var(--success-color);
}

.result-item.invalid {
    background: rgba(239, 68, 68, 0.05);
    border-left: 3px solid var(--error-color);
}

.result-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.result-content {
    flex: 1;
    min-width: 0;
}

.result-class {
    font-family: 'Consolas', 'Monaco', monospace;
    font-weight: 600;
    word-break: break-all;
}

.result-message {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.result-highlight {
    background: rgba(239, 68, 68, 0.2);
    padding: 0 2px;
    border-radius: 2px;
}

/* Auto-Fix Section */
.auto-fix-section {
    display: none;
    border-top: 2px solid var(--border-color);
    padding-top: 1.5rem;
}

.auto-fix-section.visible {
    display: block;
}

.auto-fix-section h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.auto-fix-list {
    margin-bottom: 1rem;
}

.fix-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    background: var(--bg-color);
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.fix-original {
    font-family: 'Consolas', 'Monaco', monospace;
    color: var(--error-color);
    text-decoration: line-through;
}

.fix-arrow {
    color: var(--text-secondary);
    font-weight: bold;
}

.fix-suggested {
    font-family: 'Consolas', 'Monaco', monospace;
    color: var(--success-color);
    font-weight: 600;
}

.fix-copy-btn {
    margin-left: auto;
    padding: 0.25rem 0.5rem;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.75rem;
    transition: var(--transition);
}

.fix-copy-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Footer */
.footer {
    background: var(--text-primary);
    color: white;
    text-align: center;
    padding: 1.5rem 1rem;
    margin-top: auto;
}

.footer a {
    color: #a5b4fc;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.footer a:hover {
    color: white;
    text-decoration: underline;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--text-primary);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
}

.toast.visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Scrollbar Styling */
.results-list::-webkit-scrollbar {
    width: 8px;
}

.results-list::-webkit-scrollbar-track {
    background: var(--bg-color);
    border-radius: 4px;
}

.results-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.results-list::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Responsive Design */
@media (max-width: 768px) {
    .header {
        padding: 1.5rem 1rem;
    }

    .header h1 {
        font-size: 1.4rem;
    }

    .logo-container {
        flex-direction: column;
        gap: 0.5rem;
    }

    .main-content {
        padding: 1rem;
    }

    .input-section,
    .results-section {
        padding: 1rem;
    }

    .convention-selector {
        flex-direction: column;
        align-items: stretch;
    }

    .convention-selector select {
        width: 100%;
    }

    .button-group {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .results-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .results-summary {
        width: 100%;
        justify-content: space-between;
    }

    .fix-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .fix-copy-btn {
        margin-left: 0;
        margin-top: 0.5rem;
    }

    .results-tabs {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.2rem;
    }

    .subtitle {
        font-size: 0.875rem;
    }

    #css-input {
        min-height: 150px;
        font-size: 0.8rem;
    }

    .result-item {
        flex-direction: column;
    }

    .summary-item {
        padding: 0.35rem 0.75rem;
        font-size: 0.8rem;
    }
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-item {
    animation: fadeIn 0.3s ease forwards;
}

.result-item:nth-child(1) { animation-delay: 0.05s; }
.result-item:nth-child(2) { animation-delay: 0.1s; }
.result-item:nth-child(3) { animation-delay: 0.15s; }
.result-item:nth-child(4) { animation-delay: 0.2s; }
.result-item:nth-child(5) { animation-delay: 0.25s; }
