/* CSS Naming Convention Checker - Styles */

:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --secondary-color: #64748b;
    --success-color: #22c55e;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --background-color: #f8fafc;
    --card-background: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --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, Cantarell, sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

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

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

.header-content {
    max-width: 800px;
    margin: 0 auto;
}

.logo-section {
    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;
    letter-spacing: -0.02em;
}

.tagline {
    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;
}

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

.control-group {
    margin-bottom: 1rem;
}

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

select {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: white;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
}

select:hover, select:focus {
    border-color: var(--primary-color);
    outline: none;
}

/* Convention Info */
.convention-info {
    background: #f1f5f9;
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-top: 1rem;
}

.convention-info h3 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.convention-info ul {
    list-style: none;
    font-size: 0.875rem;
}

.convention-info li {
    margin-bottom: 0.5rem;
    padding-left: 1rem;
    position: relative;
}

.convention-info li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--primary-color);
}

.convention-info code {
    background: white;
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.8rem;
    color: var(--primary-color);
}

/* Custom Rules Section */
.custom-rules-section {
    background: #f1f5f9;
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-top: 1rem;
}

.custom-rules-section h3 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.custom-rule {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.custom-rule label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    cursor: pointer;
}

.custom-rule input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
}

.custom-rule input[type="text"],
.custom-rule input[type="number"],
.custom-rule select {
    padding: 0.375rem 0.5rem;
    font-size: 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    width: auto;
    max-width: 120px;
}

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

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

.input-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

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

textarea:hover, textarea:focus {
    border-color: var(--primary-color);
    outline: none;
}

textarea::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

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

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

.btn-icon {
    font-size: 1.1rem;
}

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

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

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

.btn-secondary:hover {
    background: #475569;
}

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

.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;
    font-weight: 700;
}

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

.summary-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.summary-valid {
    color: var(--success-color);
}

.summary-invalid {
    color: var(--error-color);
}

/* 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;
    font-size: 0.9rem;
    font-weight: 500;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.tab-btn:hover {
    color: var(--text-primary);
    background: var(--background-color);
}

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

/* Results List */
.results-list {
    max-height: 500px;
    overflow-y: auto;
}

.result-item {
    display: flex;
    flex-direction: column;
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 0.75rem;
    transition: var(--transition);
}

.result-item:last-child {
    margin-bottom: 0;
}

.result-item.valid {
    background: rgba(34, 197, 94, 0.1);
    border-left: 4px solid var(--success-color);
}

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

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.result-class-name {
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.95rem;
    font-weight: 600;
    word-break: break-all;
}

.result-status {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    white-space: nowrap;
}

.result-status.valid {
    background: var(--success-color);
    color: white;
}

.result-status.invalid {
    background: var(--error-color);
    color: white;
}

.result-violations {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.violation-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--error-color);
    margin-bottom: 0.375rem;
}

.violation-icon {
    flex-shrink: 0;
}

.result-suggestion {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: rgba(99, 102, 241, 0.1);
    border-radius: var(--radius-sm);
}

.suggestion-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.suggestion-value {
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.9rem;
    color: var(--primary-color);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.suggestion-value:hover {
    text-decoration: underline;
}

.copy-btn {
    font-size: 0.75rem;
    padding: 0.125rem 0.375rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
}

.copy-btn:hover {
    background: var(--primary-hover);
}

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

.footer p {
    font-size: 0.9rem;
}

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

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

/* Utility Classes */
.hidden {
    display: none !important;
}

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

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

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

    .main-content {
        padding: 1rem;
    }

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

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

    .btn {
        width: 100%;
        justify-content: center;
    }

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

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

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

    .result-status {
        align-self: flex-start;
    }

    textarea {
        min-height: 150px;
    }
}

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

    .tagline {
        font-size: 0.875rem;
    }

    .results-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .custom-rule {
        flex-direction: column;
        align-items: flex-start;
    }

    .custom-rule input[type="text"],
    .custom-rule input[type="number"],
    .custom-rule select {
        width: 100%;
        max-width: none;
    }
}

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

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

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

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

/* 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: 0s; }
.result-item:nth-child(2) { animation-delay: 0.05s; }
.result-item:nth-child(3) { animation-delay: 0.1s; }
.result-item:nth-child(4) { animation-delay: 0.15s; }
.result-item:nth-child(5) { animation-delay: 0.2s; }
