/* Custom styles for John Deere Loyalty Program */

/* John Deere brand colors */
:root {
    --john-deere-green: #367c2b;
    --john-deere-yellow: #ffde00;
    --john-deere-dark-green: #2d5016;
    --john-deere-light-green: #4a9c3a;
    --jd-accent-foreground: #1a1a1a;
    --jd-focus-ring: rgba(255, 222, 0, 0.35);
    --jd-pending-bg: #fff8d6;
    --jd-pending-fg: #92720a;
}

/* Override Tailwind colors with John Deere theme */
.bg-primary {
    background-color: var(--john-deere-green) !important;
}

.text-primary {
    color: var(--john-deere-green) !important;
}

.text-primary-foreground {
    color: white !important;
}

.border-primary {
    border-color: var(--john-deere-green) !important;
}

.hover\:bg-primary:hover {
    background-color: var(--john-deere-dark-green) !important;
}

/* Background colors */
.bg-background {
    background-color: #f8fafc;
}

.bg-card {
    background-color: white;
}

.bg-muted {
    background-color: #f1f5f9;
}

/* Text colors */
.text-muted-foreground {
    color: #64748b;
}

.text-foreground {
    color: #0f172a;
}

/* Button styles */
.btn-primary {
    background-color: var(--john-deere-green);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--john-deere-dark-green);
}

.btn-primary:disabled {
    background-color: #9ca3af !important;
    color: #f3f4f6 !important;
    cursor: not-allowed !important;
    opacity: 0.7 !important;
}

.btn-secondary {
    background-color: #f5f8f3;
    color: var(--john-deere-green);
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    border: 1px solid rgba(54, 124, 43, 0.25);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background-color: #e8f0e5;
}

.btn-primary:focus-visible,
.btn-secondary:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--jd-focus-ring);
}

/* Card styles */
.card {
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    position: relative;
    overflow: hidden;
}

/* John Deere accent: soft ambient wash at the top edge, blending into the
   card's own corner radius instead of a hard flat bar */
.accent-stripe::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 4.5rem;
    border-radius: inherit;
    background: linear-gradient(
        180deg,
        color-mix(in oklab, var(--john-deere-yellow) 22%, transparent) 0%,
        transparent 100%
    );
    pointer-events: none;
}

.accent-stripe-bottom {
    box-shadow: inset 0 -3px 6px -2px color-mix(in oklab, var(--john-deere-yellow) 55%, transparent);
}

/* Brand mark: green tile, shared by header logo and login logo */
.logo-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--john-deere-green);
    position: relative;
    overflow: hidden;
}

/* Soft glow rising from the base rather than a hard-edged bar */
.logo-mark::after {
    content: '';
    position: absolute;
    left: 12%;
    right: 12%;
    bottom: 0;
    height: 45%;
    border-radius: inherit;
    background: linear-gradient(
        180deg,
        transparent 0%,
        color-mix(in oklab, var(--john-deere-yellow) 45%, transparent) 100%
    );
    pointer-events: none;
}

/* Active nav tab: yellow underline in addition to the existing tint */
.nav-link-active {
    box-shadow: inset 0 -3px 0 var(--john-deere-yellow);
}

/* Pending-status icon circle: warm gold instead of off-palette blue */
.icon-circle-pending {
    background-color: var(--jd-pending-bg);
}

.icon-pending {
    color: var(--jd-pending-fg) !important;
}

.card-header {
    padding: 1.5rem 1.5rem 0 1.5rem;
}

.card-content {
    padding: 1.5rem;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #0f172a;
}

/* Badge styles */
.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 9999px;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-success {
    background-color: #dcfce7;
    color: #166534;
}

.badge-warning {
    background-color: #fef3c7;
    color: #92400e;
}

.badge-error {
    background-color: #fee2e2;
    color: #991b1b;
}

/* Form styles */
.form-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.form-input.pl-10 {
    padding-left: 2.5rem;
}

.form-input:focus {
    outline: none;
    border-color: var(--john-deere-green);
    box-shadow: 0 0 0 3px rgba(54, 124, 43, 0.1);
}

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

/* Loading spinner */
.spinner {
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--john-deere-green);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive utilities */
@media (max-width: 640px) {
    .card-content {
        padding: 1rem;
    }
    
    .card-header {
        padding: 1rem 1rem 0 1rem;
    }
}

/* Grid utilities for 2 columns on medium screens */
@media (width >= 48rem) {
    .md\:grid-cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
