:root {
    --primary: #4f46e5;
    --light-gray: #f9fafb;
    --header-height: 4rem;
    --sidebar-width: 18rem;
}

/* Base Styles */
body {
    font-family: system-ui, -apple-system, sans-serif;
    background-color: white;
}

h1 {
    font-family: 'Euclid';
}

/* Colors */
.text-primary { color: var(--primary); }
.bg-primary { background-color: var(--primary); }
.hover\:bg-primary-dark:hover { background-color: #4338ca; }
.bg-featured { background-color: #fff8f0 !important; }
.focus\:ring-primary:focus { --tw-ring-color: var(--primary); }
.focus\:border-primary:focus { border-color: var(--primary); }
.hover\:text-primary:hover { color: var(--primary); }

/* Layout */
.max-container {
    max-width: 1440px;
    margin: 0 auto;
    position: relative;
}

/* Header */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: white;
    border-bottom: 1px solid #e5e7eb;
    z-index: 50;
}

.header-content {
    max-width: 1440px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 2rem;
}

.header-left {
    flex: 0 0 auto;
    margin-right: 2rem;
}

.header-center {
    flex: 1;
    max-width: 600px;
    margin: 0 auto;
    padding: 0 1rem;
}

.header-right {
    flex: 0 0 auto;
    margin-left: 2rem;
}

/* Header Search */
.header-center {
    flex: 1;
    max-width: 600px;
    margin: 0 auto;
    padding: 0 1rem;
}

.search-container {
    width: 100%;
    position: relative;
}

.search-input {
    width: 100%;
    height: 40px;
    background: white;
    font-size: 0.875rem;
    color: #374151;
}

.search-input:focus {
    outline: none;
}

.search-input::placeholder {
    color: #9CA3AF;
}

/* Mobile Search */
.mobile-search {
    display: none;
    padding: 0.75rem 1rem;
    background: white;
    border-top: 1px solid #e5e7eb;
}

@media (max-width: 768px) {
    .header-center {
        display: none;
    }

    .mobile-search {
        display: block;
    }

    .mobile-search .search-container {
        max-width: 100%;
    }
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--header-height));
    background: #f3f4f6;
    border-right: 1px solid #e5e7eb;
    padding: 2rem 1rem;
    overflow-y: auto;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 3px;
}

.category-section + .category-section {
    margin-top: 2rem;
}

/* Main Content Layout */
.content-wrapper {
    margin-left: var(--sidebar-width);
    padding: 2rem;
    min-height: calc(100vh - var(--header-height));
    background-color: #f9fafb;
}

.main-content {
    padding-top: calc(var(--header-height) + 2rem);
    max-width: 1440px;
    margin: 0 auto;
}

/* Form Container */
.form-container {
    max-width: 1024px;
    margin: 0 auto;
    padding: 0 1rem;
}

@media (max-width: 768px) {
    .form-container {
        padding: 0;
    }
}

/* Form Styles */
.form-section {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 2rem;
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #374151;
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    transition: all 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

.form-submit {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background-color: var(--primary);
    color: white;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.2s;
}

.form-submit:hover {
    background-color: var(--primary-dark);
}

/* Grid Layout */
.grid {
    display: grid;
    width: 100%;
}

.grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 640px) {
    .grid-cols-2 {
        grid-template-columns: 1fr;
    }

    .grid.gap-4 > * + * {
        margin-top: 1rem;
    }

    .form-group.mb-0 {
        margin-bottom: 1rem;
    }
}

.gap-4 {
    gap: 1rem;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .form-section {
        padding: 1.5rem;
    }

    .grid-cols-2 {
        grid-template-columns: 1fr;
    }

    .grid-cols-2 .form-group {
        margin-bottom: 1rem;
    }

    .grid-cols-3 {
        grid-template-columns: 1fr;
    }

    .form-submit {
        width: 100%;
        justify-content: center;
    }
}

/* Selected Plan Info */
.selected-plan-info {
    background-color: #f8f7ff;
    border: 1px solid var(--primary);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.selected-plan-info h3 {
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* Card Element */
#card-element {
    padding: 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    background: white;
}

#card-element.StripeElement--focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Terms Checkbox */
input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.25rem;
    cursor: pointer;
    position: relative;
}

input[type="checkbox"]:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}


/* Footer */
footer {
    margin-left: var(--sidebar-width);
    padding: 2rem;
    border-top: 1px solid #e5e7eb;
    background: white;
    margin-top: 4rem;
}


/* Plan Cards */
.plan-card {
    border: 2px solid transparent;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
}

.plan-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.plan-card.selected {
    border-color: var(--primary);
    background-color: #f8f7ff;
}

/* Tool Cards */
.tool-card {
    position: relative;
    padding: 0;
}

.tool-card .tool-link {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    cursor: pointer;
}

.tool-card-content {
    position: relative;
    z-index: 0;
}

.tool-card:hover {
    transform: translateY(-2px);
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
    .content-wrapper {
        padding: 1rem;
    }

    .form-section {
        margin-bottom: 1rem;
    }

    .form-group {
        margin-bottom: 1rem;
    }

    button[type="submit"] {
        width: 100%;
    }

    /* Terms Checkbox */
    .terms-group {
        margin: 1.5rem 0;
    }

    /* Payment Section */
    #card-element {
        padding: 0.75rem;
    }
    .header-left, .header-right {
        min-width: auto;
    }
    
    .header-content {
        padding: 0 1rem;
    }

    .content-wrapper {
        margin-left: 0;
        padding: 1rem;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .home .main-content {
        padding-top: calc(var(--header-height) + 3rem);
    }
    .main-content {
        padding-top: calc(var(--header-height) + 1rem);
    }

    footer {
        margin-left: 0;
    }

    .content-wrapper {
        margin-left: 0;
        padding: 1rem;
    }

    .main-content {
        padding-top: calc(var(--header-height) + 1rem);
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
    }

    .sidebar-open .sidebar {
        transform: translateX(0);
        z-index: 50;
        top: 0;
        height: 100vh;
    }
}

/* Admin Dashboard Styles */
.admin .header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: white;
    border-bottom: 1px solid #e5e7eb;
}

.admin .user-menu-dropdown,
.admin .user-menu-dropdown a,
.admin .user-menu-dropdown button,
.admin .user-menu-dropdown .logout-btn {
    /* Reset old styles */
    all: unset;
}