@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary-color: #336699;
    --primary-dark: #2a5580;
    --primary-light: #4d88b3;
    --secondary-color: #ec4899;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #3b82f6;
    --dark-color: #1e293b;
    --light-color: #f8fafc;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --border-radius-lg: 16px;
    --box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --box-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --box-shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

* {
    box-sizing: border-box;
}

html, body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--gray-800);
    background: white;
    min-height: 100vh;
}

body {
    margin: 0;
    padding: 0;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    color: var(--primary-dark);
    text-decoration: none;
}

/* Modern Card Styles */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: all 0.3s ease;
    background: white;
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--box-shadow-lg);
    transform: translateY(-2px);
}

.card-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    padding: 1rem 1.5rem;
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
}

/* Modern Button Styles */
.btn {
    border-radius: var(--border-radius-sm);
    font-weight: 500;
    padding: 0.625rem 1.25rem;
    border: none;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, #1e4466 100%);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
    color: white;
}

.btn-success:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning-color) 0%, #d97706 100%);
    color: white;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, #dc2626 100%);
    color: white;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: white;
}

.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
}

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

.btn-outline-secondary {
    border: 2px solid var(--gray-400);
    color: var(--gray-700);
    background: transparent;
}

.btn-outline-secondary:hover {
    background: var(--gray-200);
    color: var(--gray-900);
    border-color: var(--gray-500);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    border-radius: var(--border-radius-sm);
}

.btn-lg {
    padding: 0.875rem 1.5rem;
    font-size: 1.0625rem;
    border-radius: var(--border-radius);
}

.btn-link {
    color: var(--primary-color);
    text-decoration: none;
}

.btn-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Alert Styles */
.alert {
    border-radius: var(--border-radius-sm);
    border: none;
    padding: 1rem 1.25rem;
    box-shadow: var(--box-shadow);
}

.alert-success {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
}

.alert-info {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
}

.alert-warning {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
}

.alert-danger {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
}

/* Progress Bar */
.progress {
    height: 1rem;
    border-radius: 9999px;
    background-color: var(--gray-200);
    overflow: hidden;
    box-shadow: inset 0 1px 3px 0 rgb(0 0 0 / 0.1);
}

.progress-bar {
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--primary-light) 100%);
    transition: width 0.6s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.75rem;
}

h4 {
    font-size: 1.5rem;
}

h5 {
    font-size: 1.25rem;
}

h6 {
    font-size: 1rem;
}

/* Content Container */
.content {
    padding: 2rem 1rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

@media (min-width: 641px) {
    .content {
        padding: 2.5rem 2rem;
    }
}

/* Modern Input Styles */
.form-control {
    border-radius: var(--border-radius-sm);
    border: 2px solid var(--gray-200);
    padding: 0.625rem 1rem;
    transition: all 0.3s ease;
}

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

.form-check-input {
    border-radius: var(--border-radius-sm);
    border: 2px solid var(--gray-300);
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Utilities */
.shadow-sm {
    box-shadow: var(--box-shadow) !important;
}

.shadow {
    box-shadow: var(--box-shadow-lg) !important;
}

.shadow-lg {
    box-shadow: var(--box-shadow-xl) !important;
}

.rounded {
    border-radius: var(--border-radius) !important;
}

.rounded-lg {
    border-radius: var(--border-radius-lg) !important;
}

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

.content > * {
    animation: fadeIn 0.5s ease-out;
}

/* Error UI */
.blazor-error-boundary {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
    border-radius: var(--border-radius-sm);
    box-shadow: var(--box-shadow-lg);
}

.blazor-error-boundary::after {
    content: "An error has occurred."
}

#blazor-error-ui {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    bottom: 0;
    box-shadow: var(--box-shadow-xl);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 1rem 1.5rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    border-top: 3px solid var(--warning-color);
    color: var(--gray-900);
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 1.5rem;
    color: var(--gray-600);
    transition: color 0.3s ease;
}

#blazor-error-ui .dismiss:hover {
    color: var(--gray-900);
}

/* Custom Animations */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.animate-bounce {
    animation: bounce 1s infinite;
}

/* Validation Styles */
.valid.modified:not([type=checkbox]) {
    border-color: var(--success-color);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.invalid {
    border-color: var(--danger-color);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.validation-message {
    color: var(--danger-color);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Responsive Typography */
@media (max-width: 640px) {
    h1 {
        font-size: 2rem;
    }
    h2 {
        font-size: 1.75rem;
    }
    h3 {
        font-size: 1.5rem;
    }
}

/* Profile Hero Section */
.profile-hero {
    background: linear-gradient(135deg, #336699 0%, #2a5580 100%);
    border-radius: var(--border-radius-lg);
    padding: 3rem 2rem;
    box-shadow: var(--box-shadow-xl);
    animation: fadeIn 0.6s ease-out;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.profile-image-container {
    position: relative;
    flex-shrink: 0;
}

.profile-image {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 5px solid white;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    object-fit: cover;
    transition: transform 0.3s ease;
}

.profile-image:hover {
    transform: scale(1.05) rotate(2deg);
}

.profile-placeholder {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    font-size: 4rem;
}

.profile-badge {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 4px solid white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.profile-badge i {
    font-size: 1.25rem;
    color: white;
}

.profile-info {
    flex: 1;
    min-width: 300px;
}

.profile-name {
    font-size: 2rem;
    font-weight: 800;
    color: white;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.profile-age {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.profile-description {
    color: rgba(255, 255, 255, 0.95);
    line-height: 1.6;
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.profile-description:last-child {
    margin-bottom: 0;
}

/* Responsive Profile */
@media (max-width: 768px) {
    .profile-hero {
        padding: 2rem 1.5rem;
    }

    .profile-header {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }

    .profile-image-container {
        margin: 0 auto;
    }

    .profile-info {
        min-width: 100%;
    }

    .profile-name {
        font-size: 1.75rem;
    }

    .profile-age {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .profile-image {
        width: 120px;
        height: 120px;
    }

    .profile-badge {
        width: 38px;
        height: 38px;
    }

    .profile-badge i {
        font-size: 1rem;
    }

    .profile-name {
        font-size: 1.5rem;
    }
}

/* C# Playground Styles */
.playground-hero {
    padding: 1.5rem;
    background: linear-gradient(135deg, #336699 0%, #2a5580 100%);
    border-radius: var(--border-radius);
    color: white;
    box-shadow: var(--box-shadow-lg);
}

.playground-icon {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.code-editor {
    width: 100%;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9375rem;
    line-height: 1.5;
    padding: 1rem;
    border: none;
    resize: vertical;
    background-color: #1e293b;
    color: #e2e8f0;
    min-height: 400px;
}

.code-editor:focus {
    outline: none;
    background-color: #0f172a;
}

.code-editor::placeholder {
    color: #64748b;
}

.output-console {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9375rem;
    line-height: 1.5;
    padding: 1rem;
    border-radius: var(--border-radius-sm);
    min-height: 400px;
    max-height: 600px;
    overflow-y: auto;
}

.output-success {
    background-color: #f0fdf4;
    color: #166534;
    border: 1px solid #86efac;
}

.output-error {
    background-color: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.output-console pre {
    white-space: pre-wrap;
    word-wrap: break-word;
}

.output-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    color: var(--gray-400);
    text-align: center;
}

.output-placeholder i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.output-placeholder p {
    margin: 0;
    font-size: 1.125rem;
}

.tip-card {
    padding: 1rem;
    background: var(--gray-50);
    border-radius: var(--border-radius-sm);
    border-left: 4px solid var(--primary-color);
}

.tip-card code {
    background: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.875rem;
    color: var(--primary-color);
    border: 1px solid var(--gray-200);
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
}

/* Login Form Styles */
.form-label {
    font-weight: 600;
    color: var(--gray-700);
}

.form-control {
    border-radius: var(--border-radius-sm);
    border: 2px solid var(--gray-200);
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.card-header.bg-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%) !important;
}

/* App Header Styles */
.app-header {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    padding: 1rem 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.header-left {
    display: flex;
    align-items: center;
}

.header-logo {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-color);
    display: flex;
    align-items: center;
}

.header-logo i {
    font-size: 1.75rem;
}

.header-right {
    display: flex;
    align-items: center;
}

.user-info {
    display: flex;
    align-items: center;
    font-weight: 500;
    color: var(--gray-700);
}

.user-name {
    color: var(--primary-color);
    font-weight: 600;
}

@media (max-width: 768px) {
    .app-header {
        padding: 1rem;
    }

    .header-logo {
        font-size: 1.25rem;
    }

    .user-info {
        font-size: 0.875rem;
    }
}
