/* Custom styles for Job Photo App */

:root{
    --brand-color: #b82c17;
    --brand-color-hover: #a12614;
    --jobs-bg-start: #178E9C;
    --jobs-bg-mid: #1FA6B4;
    --jobs-bg-end: #E6F6F8;
}

/* Mobile-first responsive design */
@media (max-width: 640px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .btn {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
    
    .form-input {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Touch-friendly interactions */
.btn, .form-input, select, button {
    min-height: 44px; /* iOS recommended touch target size */
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Loading spinner */
.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

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

/* File upload area */
.upload-area {
    border: 2px dashed #cbd5e0;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
}

.upload-area:hover {
    border-color: #4299e1;
    background-color: #f7fafc;
}

.upload-area.dragover {
    border-color: #4299e1;
    background-color: #ebf8ff;
}

/* Photo grid */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.photo-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.photo-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Responsive design */
@media (max-width: 768px) {
    .photo-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 0.5rem;
    }
}

/* Toast notifications */
.toast {
    position: fixed;
    top: 1rem;
    right: 1rem;
    padding: 1rem;
    border-radius: 8px;
    color: white;
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

.toast.success {
    background-color: #10b981;
}

.toast.error {
    background-color: #ef4444;
}

.toast.warning {
    background-color: #f59e0b;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Form styles */
.form-group {
    margin-bottom: 1rem;
}

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

.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--brand-color);
    box-shadow: 0 0 0 3px rgba(184, 44, 23, 0.15);
}

/* Button styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    font-size: 1rem;
}

.btn-primary {
    background-color: var(--brand-color) !important;
    border-color: var(--brand-color) !important;
    color: #fff !important;
}

.btn-primary:hover {
    background-color: var(--brand-color-hover) !important;
    border-color: var(--brand-color-hover) !important;
}

/* Jobs section background (behind cards) */
.bg-jobs-gradient{
    background: linear-gradient(180deg, var(--jobs-bg-start) 0%, var(--jobs-bg-mid) 50%, var(--jobs-bg-end) 100%);
}

/* Jobs section background using image with gradient overlay */
.bg-jobs-hero{
    /* Fallback solid/gradient color first */
    background-color: var(--jobs-bg-start);
    background-image: linear-gradient(180deg, rgba(68, 23, 43, 0.85) 0%, rgba(180, 31, 130, 0.65) 40%, rgba(241, 248, 230, 0.5) 100%);
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

/* Mustard / beige light gradient (no image) */
.bg-jobs-space{
    /* Solid brand background (no gradient) */
    background-color: #b82c17;
    background-image: none;
    background-repeat: no-repeat;
    background-size: cover;
    background-attachment: fixed;
    /* subtle inset shadows where header/footer meet background */
    box-shadow: inset 0 18px 36px rgba(0,0,0,0.20), inset 0 -12px 24px rgba(0,0,0,0.06);
}

/* Strong drop shadow from the filters row onto background */
.filters-shadow{
    box-shadow: 0 28px 40px -18px rgba(0,0,0,0.35), 0 10px 20px -12px rgba(0,0,0,0.25);
    position: relative;
    z-index: 5;
}

/* Uniform icon button sizing (anchors or buttons) */
.icon-btn{
    width: 2.75rem;   /* 44px */
    height: 2.75rem;  /* 44px */
    min-width: 2.75rem;
    min-height: 2.75rem;
}

/* Large pill to match icon button height */
.pill-lg{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 2.75rem;       /* 44px to match .icon-btn */
    padding-left: 0.75rem; /* px-3 */
    padding-right: 0.75rem;
}

/* Ensure status pill keeps size even after HTMX swaps */
#jobStatus{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 2.75rem;
    padding: 0 0.75rem;
    border-radius: 9999px; /* keep pill shape if classes are replaced */
}
/* Global app surface: brand red background */
.app-surface{
    background-color: #b82c17;
    box-shadow: inset 0 18px 36px rgba(0,0,0,0.20), inset 0 -12px 24px rgba(0,0,0,0.06);
    min-height: 100vh; /* ensure full-screen fill even with little content */
}

/* Cream card surfaces (target only card containers) */
.theme-cream .bg-white.rounded-lg,
.cream-cards .bg-white.rounded-lg{
    background-color: #FFF7EE !important; /* soft cream */
}
.theme-cream .rounded-lg.border,
.cream-cards .rounded-lg.border{
    border-color: rgba(0,0,0,0.08) !important; /* slightly softer border on cards */
}

/* Also tint smaller cards */
.theme-cream .bg-white.rounded-md,
.cream-cards .bg-white.rounded-md{
    background-color: #FFF7EE !important;
}
.theme-cream .rounded-md.border,
.cream-cards .rounded-md.border{
    border-color: rgba(0,0,0,0.08) !important;
}

/* Do not tint small icon buttons - keep truly white behind icons */
.theme-cream .icon-btn.bg-white{
    background-color: #FFFFFF !important;
}
/* Utility: cream background to match app cards */
.bg-cream{
    background-color: #FFF7EE !important;
}

.btn-secondary {
    background-color: #6b7280;
    color: white;
}

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

.btn-danger {
    background-color: #ef4444;
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
}

/* Image grid and gallery styles */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 0.25rem;
    max-width: 100%;
}

.example-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.5rem;
    max-width: 100%;
}

.square-image-container {
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 0.5rem;
}

.square-image {
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: opacity 0.2s;
    width: 100%;
    height: auto;
}

.square-image:hover {
    opacity: 0.75;
}

.gallery-container {
    position: relative;
    overflow: hidden;
}

.gallery-slide {
    display: none;
    text-align: center;
}

.gallery-slide.active {
    display: block;
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.gallery-nav:hover {
    background: rgba(0, 0, 0, 0.7);
}

.gallery-nav.prev {
    left: 1rem;
}

.gallery-nav.next {
    right: 1rem;
}

.gallery-counter {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.875rem;
}

.uploaded-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.5rem;
    max-width: 100%;
} 

/* HTMX indicator visibility (scoped to indicator element) */
.htmx-indicator { display: none; }
.htmx-indicator.htmx-request { display: flex; }

/* Line clamp utilities (no Tailwind plugin required) */
.clamp-1,.clamp-2,.clamp-3{ display:-webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-1{ -webkit-line-clamp: 1; }
.clamp-2{ -webkit-line-clamp: 2; }
.clamp-3{ -webkit-line-clamp: 3; } 