@import 'tailwindcss';

@source '../../vendor/laravel/framework/src/Illuminate/Pagination/resources/views/*.blade.php';
@source '../../storage/framework/views/*.php';
@source '../**/*.blade.php';
@source '../**/*.js';

@theme {
    --font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji',
        'Segoe UI Symbol', 'Noto Color Emoji';
    --font-serif: 'Playfair Display', Georgia, 'Times New Roman', Times, serif;

    --color-umbera-50: #fef2f2;
    --color-umbera-100: #fee2e2;
    --color-umbera-200: #fecaca;
    --color-umbera-300: #fca5a5;
    --color-umbera-400: #f87171;
    --color-umbera-500: #8B0000;
    --color-umbera-600: #6B0000;
    --color-umbera-700: #4D0000;
    --color-umbera-800: #3A0000;
    --color-umbera-900: #2A0000;
    --color-umbera-950: #1A0000;

    --color-neutral-50: #fafafa;
    --color-neutral-100: #f5f5f5;
    --color-neutral-200: #e5e5e5;
    --color-neutral-300: #d4d4d4;
    --color-neutral-400: #a3a3a3;
    --color-neutral-500: #737373;
    --color-neutral-600: #525252;
    --color-neutral-700: #404040;
    --color-neutral-800: #262626;
    --color-neutral-900: #171717;
    --color-neutral-950: #0a0a0a;

    --color-success-50: #f0fdf4;
    --color-success-100: #dcfce7;
    --color-success-500: #16a34a;
    --color-success-600: #15803d;
    --color-success-700: #166534;

    --color-warning-50: #fffbeb;
    --color-warning-100: #fef3c7;
    --color-warning-500: #d97706;
    --color-warning-600: #b45309;

    --color-error-50: #fef2f2;
    --color-error-100: #fee2e2;
    --color-error-500: #dc2626;
    --color-error-600: #b91c1c;

    --color-info-50: #eff6ff;
    --color-info-100: #dbeafe;
    --color-info-500: #2563eb;
    --color-info-600: #1d4ed8;

    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
    --shadow-card-hover: 0 4px 12px rgba(0, 0, 0, 0.06), 0 2px 4px rgba(0, 0, 0, 0.03);
    --shadow-elevated: 0 10px 25px rgba(0, 0, 0, 0.08), 0 4px 10px rgba(0, 0, 0, 0.04);

    --animate-fade-in: fadeIn 0.4s ease-out;
    --animate-slide-up: slideUp 0.4s ease-out;
    --animate-scale-in: scaleIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

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

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

@layer base {
    html {
        scroll-behavior: smooth;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
    body {
        font-family: var(--font-sans);
        background-color: var(--color-neutral-50);
        color: var(--color-neutral-800);
        line-height: 1.6;
    }
    h1, h2, h3, h4, h5, h6 {
        font-family: var(--font-serif);
        color: var(--color-neutral-900);
        letter-spacing: -0.01em;
    }
    ::selection {
        background-color: var(--color-umbera-500);
        color: white;
    }
}

@layer components {
    .btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        padding: 0.75rem 1.5rem;
        font-size: 0.875rem;
        font-weight: 500;
        line-height: 1.25rem;
        border-radius: 0.5rem;
        border: 1px solid transparent;
        cursor: pointer;
        transition: all 0.2s ease;
        white-space: nowrap;
        text-decoration: none;
    }
    .btn:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }
    .btn-primary {
        background-color: var(--color-umbera-500);
        color: white;
    }
    .btn-primary:hover:not(:disabled) {
        background-color: var(--color-umbera-600);
        box-shadow: 0 4px 12px rgba(139, 0, 0, 0.25);
    }
    .btn-secondary {
        background-color: white;
        color: var(--color-neutral-800);
        border-color: var(--color-neutral-200);
    }
    .btn-secondary:hover:not(:disabled) {
        background-color: var(--color-neutral-50);
        border-color: var(--color-neutral-300);
    }
    .btn-outline {
        background-color: transparent;
        color: var(--color-umbera-500);
        border-color: var(--color-umbera-500);
    }
    .btn-outline:hover:not(:disabled) {
        background-color: var(--color-umbera-50);
    }
    .btn-ghost {
        background-color: transparent;
        color: var(--color-neutral-600);
    }
    .btn-ghost:hover:not(:disabled) {
        background-color: var(--color-neutral-100);
        color: var(--color-neutral-800);
    }
    .btn-sm {
        padding: 0.5rem 1rem;
        font-size: 0.8125rem;
    }
    .btn-lg {
        padding: 1rem 2rem;
        font-size: 1rem;
    }

    .cert-template-container {
        position: relative;
        isolation: isolate;
    }
    .cert-template-container img {
        user-select: none;
        -webkit-user-drag: none;
    }
    .cert-template-container .cert-overlay-name,
    .cert-template-container .cert-overlay-course {
        pointer-events: none;
        user-select: none;
        text-shadow: 0 1px 2px rgba(255, 255, 255, 0.4);
    }
    @media (max-width: 640px) {
        .cert-template-container .cert-overlay-name {
            font-size: 92% !important;
        }
        .cert-template-container .cert-overlay-course {
            font-size: 88% !important;
        }
    }

    .input-field {
        width: 100%;
        padding: 0.75rem 1rem;
        font-size: 0.9375rem;
        line-height: 1.5;
        background-color: white;
        border: 1px solid var(--color-neutral-200);
        border-radius: 0.5rem;
        color: var(--color-neutral-800);
        transition: all 0.2s ease;
    }
    .input-field:focus {
        outline: none;
        border-color: var(--color-umbera-500);
        box-shadow: 0 0 0 3px rgba(139, 0, 0, 0.08);
    }
    .input-field::placeholder {
        color: var(--color-neutral-400);
    }

    .card {
        background-color: white;
        border: 1px solid var(--color-neutral-200);
        border-radius: 1rem;
        box-shadow: var(--shadow-card);
    }
    .card-hover {
        transition: all 0.25s ease;
    }
    .card-hover:hover {
        box-shadow: var(--shadow-card-hover);
        transform: translateY(-1px);
    }

    .badge {
        display: inline-flex;
        align-items: center;
        gap: 0.25rem;
        padding: 0.25rem 0.75rem;
        font-size: 0.75rem;
        font-weight: 500;
        line-height: 1;
        border-radius: 9999px;
        white-space: nowrap;
    }
    .badge-success {
        background-color: var(--color-success-50);
        color: var(--color-success-600);
    }
    .badge-warning {
        background-color: var(--color-warning-50);
        color: var(--color-warning-600);
    }
    .badge-error {
        background-color: var(--color-error-50);
        color: var(--color-error-600);
    }
    .badge-info {
        background-color: var(--color-info-50);
        color: var(--color-info-600);
    }
    .badge-neutral {
        background-color: var(--color-neutral-100);
        color: var(--color-neutral-700);
    }
    .badge-umbera {
        background-color: var(--color-umbera-50);
        color: var(--color-umbera-500);
    }

    .modal-backdrop {
        position: fixed;
        inset: 0;
        background-color: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(4px);
        z-index: 40;
        animation: fadeIn 0.2s ease-out;
    }
    .modal-container {
        position: fixed;
        inset: 0;
        z-index: 50;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 1rem;
    }
    .modal-panel {
        width: 100%;
        max-width: 32rem;
        max-height: 90vh;
        overflow-y: auto;
        background-color: white;
        border-radius: 1rem;
        box-shadow: var(--shadow-elevated);
        animation: scaleIn 0.3s ease-out;
    }

    .sidebar-link {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        padding: 0.625rem 0.875rem;
        font-size: 0.875rem;
        color: var(--color-neutral-600);
        border-radius: 0.5rem;
        transition: all 0.15s ease;
    }
    .sidebar-link:hover {
        background-color: var(--color-neutral-100);
        color: var(--color-neutral-900);
    }
    .sidebar-link.active {
        background-color: var(--color-umbera-50);
        color: var(--color-umbera-500);
        font-weight: 500;
    }

    .stat-card {
        background-color: white;
        border: 1px solid var(--color-neutral-200);
        border-radius: 0.75rem;
        padding: 1.5rem;
    }

    .data-table {
        width: 100%;
        border-collapse: collapse;
    }
    .data-table th {
        text-align: left;
        padding: 0.75rem 1rem;
        font-size: 0.75rem;
        font-weight: 600;
        color: var(--color-neutral-500);
        text-transform: uppercase;
        letter-spacing: 0.05em;
        background-color: var(--color-neutral-50);
        border-bottom: 1px solid var(--color-neutral-200);
    }
    .data-table td {
        padding: 1rem;
        font-size: 0.875rem;
        color: var(--color-neutral-700);
        border-bottom: 1px solid var(--color-neutral-100);
    }
    .data-table tbody tr:hover {
        background-color: var(--color-neutral-50);
    }

    .toast {
        position: fixed;
        top: 1rem;
        right: 1rem;
        z-index: 100;
        display: flex;
        align-items: center;
        gap: 0.75rem;
        padding: 1rem 1.25rem;
        background-color: white;
        border: 1px solid var(--color-neutral-200);
        border-radius: 0.75rem;
        box-shadow: var(--shadow-elevated);
        animation: slideUp 0.3s ease-out;
    }

    .spinner {
        width: 1.25rem;
        height: 1.25rem;
        border: 2px solid currentColor;
        border-right-color: transparent;
        border-radius: 9999px;
        animation: spin 0.75s linear infinite;
    }

    .step-indicator {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.5rem;
    }
    .step-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
        flex: 1;
        position: relative;
    }
    .step-item:not(:last-child)::after {
        content: '';
        position: absolute;
        top: 1rem;
        left: 60%;
        width: 80%;
        height: 2px;
        background-color: var(--color-neutral-200);
        z-index: 0;
    }
    .step-item.completed:not(:last-child)::after {
        background-color: var(--color-success-500);
    }
    .step-circle {
        width: 2rem;
        height: 2rem;
        border-radius: 9999px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.875rem;
        font-weight: 600;
        position: relative;
        z-index: 1;
    }
}

@layer utilities {
    .animate-fade-in {
        animation: var(--animate-fade-in);
    }
    .animate-slide-up {
        animation: var(--animate-slide-up);
    }
    .animate-scale-in {
        animation: var(--animate-scale-in);
    }
}
