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

:root {
    --primary: #2563eb;
    --primary-light: #60a5fa;
    --primary-dark: #1e40af;
    --background: #f8fafc;
    --card-bg: rgba(255, 255, 255, 0.8);
    --text-main: #1e293b;
    --text-muted: #64748b;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.4);
    --shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--background);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Header Section */
header {
    height: 400px;
    background: url('assets/header_bg.png') no-repeat center center;
    background-size: cover;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2rem;
    position: relative;
    color: white;
}

header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(to top, var(--background), transparent);
}

.header-content {
    z-index: 2;
    max-width: 800px;
}

h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(to right, #fff, #bfdbfe);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.subtitle {
    font-size: 1.25rem;
    opacity: 0.9;
    font-weight: 300;
    letter-spacing: 0.5px;
}

/* Main Content */
main {
    max-width: 1400px;
    margin: -50px auto 50px;
    padding: 0 2rem;
    position: relative;
    z-index: 5;
}

.search-container {
    margin-bottom: 3rem;
    display: flex;
    justify-content: center;
}

#search-input {
    width: 100%;
    max-width: 600px;
    padding: 1.25rem 2rem;
    border-radius: 50px;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow);
    font-size: 1rem;
    outline: none;
    transition: var(--transition);
}

#search-input:focus {
    box-shadow: 0 15px 40px -10px rgba(37, 99, 235, 0.2);
    border-color: var(--primary-light);
}

/* Grid Layout */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

.card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2rem;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.15);
    background: white;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary);
    transform: scaleY(0);
    transition: var(--transition);
}

.card:hover::before {
    transform: scaleY(1);
}

.card h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: var(--text-main);
}

.card p {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-badge {
    background: #eff6ff;
    color: var(--primary);
    padding: 0.4rem 1rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Form and Print View */
.view {
    display: none;
}

.view.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

.print-template {
    display: none;
    /* Hidden on web */
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-container {
    background: white;
    padding: 3rem;
    border-radius: 32px;
    box-shadow: var(--shadow);
    max-width: 900px;
    margin: 0 auto;
}

.btn-back {
    margin-bottom: 2rem;
    background: none;
    border: none;
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
}

.btn-back:hover {
    transform: translateX(-5px);
}

/* Responsive */
@media (max-width: 768px) {
    h1 {
        font-size: 2.2rem;
    }

    header {
        height: 300px;
    }

    main {
        padding: 0 1rem;
        margin-top: -30px;
    }

    .form-container {
        padding: 1.5rem;
    }
}

/* Print Styling */
@media print {
    @page {
        margin: 2cm;
    }

    header,
    .search-container,
    .btn-back,
    #print-btn,
    #web-form-fields,
    h2 {
        display: none !important;
    }

    body {
        background: white;
        font-family: "Times New Roman", serif;
        color: black;
    }

    main {
        margin: 0;
        padding: 0;
    }

    .form-container {
        box-shadow: none;
        padding: 0;
        margin: 0;
    }

    .print-template {
        display: block !important;
        /* Visible ONLY on print */
    }

    .print-header {
        text-align: right;
        margin-bottom: 50px;
    }
}