/* CSS Syntax Validator - Modern Mobile-First Design */

/* Main Workspace */
.css-validator-workspace {
    margin-bottom: 2rem;
}

.workspace-main {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

@media (min-width: 992px) {
    .workspace-main {
        grid-template-columns: 1fr 1fr;
    }
}

/* Editor Section */
.editor-section {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 500px;
}

.editor-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.editor-label {
    color: #ffffff;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.3px;
}

.toolbar-actions {
    display: flex;
    gap: 0.5rem;
}

.toolbar-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: #ffffff;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

.toolbar-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

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

.toolbar-btn svg {
    flex-shrink: 0;
}

@media (max-width: 640px) {
    .toolbar-btn span {
        display: none;
    }
    
    .toolbar-btn {
        padding: 0.5rem;
        min-width: 36px;
        justify-content: center;
    }
}

/* CSS Editor */
.css-editor {
    flex: 1;
    min-height: 400px;
    background: #1e1e1e;
    position: relative;
}

#cssEditor {
    width: 100%;
    height: 100%;
}

.editor-footer {
    padding: 1rem 1.25rem;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

.validate-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.validate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

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

.validate-btn svg {
    flex-shrink: 0;
}

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

/* Results Section */
.results-section {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 500px;
}

.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.results-title-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.results-title-wrapper svg {
    color: #667eea;
    flex-shrink: 0;
}

.results-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #212529;
    margin: 0;
}

.results-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.875rem;
    background: #e9ecef;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #6c757d;
    display: inline-block;
    animation: pulse 2s infinite;
}

.status-dot.success {
    background: #28a745;
}

.status-dot.error {
    background: #dc3545;
}

.status-dot.warning {
    background: #ffc107;
}

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

.status-text {
    color: #495057;
}

.results-body {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    max-height: 600px;
}

.results-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
    text-align: center;
    min-height: 300px;
}

.placeholder-icon {
    color: #adb5bd;
    margin-bottom: 1rem;
}

.placeholder-text {
    color: #6c757d;
    font-size: 0.95rem;
    margin: 0;
}

/* Validation Results */
.validation-success {
    padding: 1.25rem;
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-left: 4px solid #28a745;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.validation-success-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.validation-success-icon {
    width: 24px;
    height: 24px;
    background: #28a745;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.validation-success-icon svg {
    width: 14px;
    height: 14px;
    color: #ffffff;
}

.validation-success-text {
    color: #155724;
    font-weight: 600;
    font-size: 1rem;
}

.errors-container,
.warnings-container {
    margin-bottom: 1.5rem;
}

.errors-header,
.warnings-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: 8px 8px 0 0;
    font-weight: 600;
    font-size: 0.95rem;
}

.errors-header {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
}

.warnings-header {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #856404;
}

.errors-header svg,
.warnings-header svg {
    flex-shrink: 0;
}

.errors-list,
.warnings-list {
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-top: none;
    border-radius: 0 0 8px 8px;
    padding: 0.75rem;
}

.error-item,
.warning-item {
    padding: 0.875rem;
    border-left: 3px solid;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    background: #f8f9fa;
    transition: all 0.2s ease;
}

.error-item {
    border-left-color: #dc3545;
}

.error-item:hover {
    background: #f1f3f5;
    transform: translateX(4px);
}

.warning-item {
    border-left-color: #ffc107;
}

.warning-item:hover {
    background: #f1f3f5;
    transform: translateX(4px);
}

.error-item:last-child,
.warning-item:last-child {
    margin-bottom: 0;
}

.error-line,
.warning-line {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.error-line-number,
.warning-line-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 24px;
    padding: 0 0.5rem;
    background: #e9ecef;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #495057;
}

.error-message,
.warning-message {
    font-size: 0.9rem;
    color: #212529;
    font-weight: 500;
}

.error-type,
.warning-type {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.25rem;
}

.error-type {
    background: #f8d7da;
    color: #721c24;
}

.warning-type {
    background: #fff3cd;
    color: #856404;
}

/* Analysis Panel - Now inside results section */
.analysis-panel {
    border-top: 2px solid #e9ecef;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
}

.analysis-header {
    padding: 0 0 1rem 0;
    border-bottom: 1px solid #e9ecef;
    margin-bottom: 1rem;
}

.analysis-title {
    font-size: 1rem;
    font-weight: 600;
    color: #495057;
    margin: 0;
}

.analysis-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.875rem;
    padding: 0;
}

@media (min-width: 640px) {
    .analysis-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.analysis-item {
    text-align: center;
    padding: 1.25rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 8px;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.analysis-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #667eea;
}

.analysis-label {
    font-size: 0.875rem;
    color: #6c757d;
    font-weight: 500;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.analysis-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #667eea;
    line-height: 1.2;
}

/* Mobile Optimizations */
@media (max-width: 767px) {
    .css-validator-workspace {
        margin-top: 1.5rem;
    }
    
    .workspace-main {
        gap: 1rem;
    }
    
    .editor-section,
    .results-section {
        min-height: 400px;
    }
    
    .css-editor {
        min-height: 350px;
    }
    
    .results-body {
        padding: 1rem;
        max-height: 400px;
    }
    
    .analysis-panel {
        margin-top: 1rem;
        padding-top: 1rem;
    }
    
    .analysis-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .analysis-item {
        padding: 1rem;
    }
    
    .analysis-value {
        font-size: 1.5rem;
    }
}

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

.results-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.results-body::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 4px;
}

.results-body::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* Loading State */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e9ecef;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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