/* JSON to C# Model Generator Styles */
:root {
    --primary-color: #7c3aed;
    --primary-hover: #6d28d9;
    --secondary-color: #3b82f6;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --dark-color: #1f2937;
    --light-color: #f9fafb;
    --border-color: #e5e7eb;
    --code-bg: #1e1e1e;
    --code-text: #d4d4d4;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.2);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --border-radius: 12px;
    --border-radius-lg: 16px;
}

/* Container */
.json-to-cs-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1rem;
    min-height: 100vh;
}

/* Page Header */
.page-header {
    text-align: center;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 3px solid var(--border-color);
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.05) 0%, rgba(59, 130, 246, 0.05) 100%);
    border-radius: var(--border-radius-lg);
    padding: 3rem 2rem 2rem;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.icon-wrapper {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    animation: float 3s ease-in-out infinite;
    position: relative;
}

.icon-wrapper::before {
    content: '';
    position: absolute;
    inset: -4px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 26px;
    opacity: 0.3;
    filter: blur(10px);
    z-index: -1;
}

.icon-wrapper i {
    font-size: 3rem;
    color: white;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(2deg); }
}

.header-text {
    text-align: left;
}

.page-title {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.75rem;
}

.page-description {
    font-size: 1.2rem;
    color: #6b7280;
    margin: 0;
    font-weight: 500;
}

/* Converter Card */
.converter-card {
    background: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    padding: 2.5rem;
    margin-bottom: 3rem;
    border: 1px solid var(--border-color);
}

/* Input Section */
.input-section {
    margin-bottom: 2rem;
}

.config-panel {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.05) 0%, rgba(59, 130, 246, 0.05) 100%);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 2px dashed var(--primary-color);
}

.config-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
}

.form-group label i {
    color: var(--primary-color);
    font-size: 1.1rem;
}

.form-control {
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: var(--transition);
    background: white;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.form-group small {
    margin-top: 0.25rem;
    color: #9ca3af;
    font-size: 0.85rem;
}

/* Upload Area */
.upload-area {
    border: 3px dashed var(--border-color);
    border-radius: var(--border-radius);
    padding: 2rem;
    background: var(--light-color);
    transition: var(--transition);
}

.upload-area:hover {
    border-color: var(--primary-color);
    background: rgba(124, 58, 237, 0.03);
}

.upload-content {
    text-align: center;
}

.upload-icon {
    font-size: 4rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    display: block;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-12px) scale(1.05); }
}

.upload-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 1rem;
}

.json-input {
    width: 100%;
    border-radius: 10px;
    border: 2px solid var(--border-color);
    padding: 1.25rem;
    font-size: 0.95rem;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    background: #fafafa;
    resize: vertical;
    transition: var(--transition);
    min-height: 200px;
}

.json-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.file-info {
    margin-top: 1rem;
}

/* Action Section */
.action-section {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.btn {
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    border: none;
    box-shadow: var(--shadow-md);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-convert {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
}

.btn-convert:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.btn-convert:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-clear {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
    color: white;
}

.btn-clear:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.btn i {
    font-size: 1.3rem;
}

/* Loading Section */
.loading-section {
    text-align: center;
    padding: 4rem 0;
}

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.spinner {
    width: 70px;
    height: 70px;
    border: 5px solid rgba(124, 58, 237, 0.2);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-spinner p {
    font-size: 1.2rem;
    color: #6b7280;
    margin: 0;
    font-weight: 600;
}

/* Results Section */
.results-section {
    margin-top: 3rem;
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-left i {
    font-size: 1.8rem;
    color: var(--primary-color);
}

.header-left h3 {
    margin: 0;
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--dark-color);
}

.header-actions {
    display: flex;
    gap: 0.75rem;
}

.btn-action {
    background: var(--success-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.95rem;
}

.btn-action:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-action:nth-child(2) {
    background: var(--secondary-color);
}

.btn-action.copied {
    background: var(--warning-color);
    animation: pulse 0.5s ease-out;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

/* Code Preview */
.code-preview {
    background: var(--code-bg);
    border-radius: 12px;
    padding: 0;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    border: 2px solid #2d2d2d;
}

.code-output {
    color: var(--code-text);
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
    padding: 2rem;
    white-space: pre;
    overflow-x: auto;
    max-height: 600px;
    overflow-y: auto;
}

/* Syntax Highlighting Colors */
.code-output {
    color: #d4d4d4;
}

/* Stats Section */
.stats-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border-color);
}

.stat-item {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.05) 0%, rgba(59, 130, 246, 0.05) 100%);
    padding: 1.5rem;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 1rem;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.stat-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-item i {
    font-size: 2rem;
    color: var(--primary-color);
}

.stat-label {
    font-weight: 600;
    color: #6b7280;
    font-size: 0.9rem;
}

.stat-value {
    font-weight: 800;
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-left: auto;
}

/* Alert Container */
.alert-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1050;
    max-width: 400px;
}

.alert {
    padding: 1.25rem 1.5rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-xl);
    display: flex;
    align-items: center;
    gap: 1rem;
    animation: slideInRight 0.4s ease-out;
    border: 1px solid;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(120%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border-color: #6ee7b7;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fca5a5;
}

.alert i {
    font-size: 1.5rem;
}

.alert-close {
    margin-left: auto;
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    opacity: 0.7;
    transition: var(--transition);
}

.alert-close:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* Info Section */
.info-section {
    margin-top: 4rem;
}

.info-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    height: 100%;
    border: 1px solid var(--border-color);
}

.info-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.info-icon {
    width: 90px;
    height: 90px;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.1) 0%, rgba(59, 130, 246, 0.1) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    transition: var(--transition);
}

.info-card:hover .info-icon {
    transform: scale(1.1) rotate(5deg);
}

.info-icon i {
    font-size: 2.5rem;
    color: var(--primary-color);
}

.info-card h3 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--dark-color);
}

.info-card p {
    color: #6b7280;
    line-height: 1.7;
    margin: 0;
    font-size: 1rem;
}

/* Examples Section */
.examples-section {
    margin-top: 4rem;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.03) 0%, rgba(59, 130, 246, 0.03) 100%);
    padding: 3rem;
    border-radius: var(--border-radius-lg);
}

.section-title {
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: var(--dark-color);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.section-title i {
    color: var(--warning-color);
    font-size: 2.2rem;
}

.example-card {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 2rem;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
    text-align: center;
}

.example-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.example-card i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.example-card h4 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
}

.example-card p {
    color: #6b7280;
    margin: 0;
    font-size: 0.95rem;
}

/* Scrollbar Styles */
.code-output::-webkit-scrollbar,
.json-input::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.code-output::-webkit-scrollbar-track {
    background: #2d2d2d;
    border-radius: 5px;
}

.code-output::-webkit-scrollbar-thumb {
    background: #4a4a4a;
    border-radius: 5px;
}

.code-output::-webkit-scrollbar-thumb:hover {
    background: #5a5a5a;
}

/* Responsive Design */
@media (max-width: 768px) {
    .page-title {
        font-size: 2rem;
    }

    .page-description {
        font-size: 1rem;
    }

    .header-content {
        flex-direction: column;
    }

    .header-text {
        text-align: center;
    }

    .converter-card {
        padding: 1.5rem;
    }

    .config-row {
        grid-template-columns: 1fr;
    }

    .result-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .header-actions {
        width: 100%;
        justify-content: space-between;
    }

    .stats-section {
        grid-template-columns: 1fr;
    }

    .alert-container {
        right: 10px;
        left: 10px;
        max-width: none;
    }

    .examples-section {
        padding: 2rem 1rem;
    }

    .action-section {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print Styles */
@media print {
    .upload-area,
    .action-section,
    .info-section,
    .examples-section,
    .btn-action,
    .alert-container {
        display: none;
    }

    .converter-card {
        box-shadow: none;
        border: 1px solid var(--border-color);
    }

    .code-output {
        max-height: none;
    }
}
