/* Web Build Data Collector - Custom Styles */

/* ==========================================================================
   CSS Variables
   ========================================================================== */
:root {
    --primary: #ef4136;       /* Red */
    --secondary: #003049;     /* Dark Blue */
    --dark: #333333;          /* Grey */
    --light: #F5F5F5;         /* Off white */
    --grey: #727070;          /* Light Grey */
    --accent: #a7b4a8;        /* Light Green/grey */
    --accent2: #accaec;       /* Light blue */
    --white: #ffffff;         /* White */
    --success: #22c55e;       /* Green */
    --warning: #f59e0b;       /* Orange */
    --error: #ef4444;         /* Red error */
}

/* ==========================================================================
   PIN Input Styling
   ========================================================================== */
.pin-input {
    font-family: 'Courier New', monospace;
    font-size: 2.5rem;
    letter-spacing: 0.75em;
    text-align: center;
    padding-left: 0.75em;
}

.pin-input::placeholder {
    letter-spacing: 0.5em;
}

.pin-input::-webkit-outer-spin-button,
.pin-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.pin-input[type=number] {
    -moz-appearance: textfield;
}

/* ==========================================================================
   Color Picker Enhancement
   ========================================================================== */
.color-picker-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.color-picker-input {
    width: 3rem;
    height: 3rem;
    padding: 0;
    border: 2px solid var(--light);
    border-radius: 0.5rem;
    cursor: pointer;
    overflow: hidden;
    background: var(--white);
}

.color-picker-input::-webkit-color-swatch-wrapper {
    padding: 0;
}

.color-picker-input::-webkit-color-swatch {
    border: none;
    border-radius: 0.375rem;
}

.color-preview-chip {
    display: inline-block;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 0.25rem;
    border: 1px solid var(--grey);
    vertical-align: middle;
}

/* ==========================================================================
   Progress Bar
   ========================================================================== */
.progress-ring {
    transform: rotate(-90deg);
}

.progress-ring-circle {
    transition: stroke-dashoffset 0.35s;
    transform-origin: 50% 50%;
}

/* ==========================================================================
   Form Sections
   ========================================================================== */
.form-section {
    background: var(--white);
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--light);
}

.form-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--light);
}

.form-section-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--dark);
}

/* ==========================================================================
   Sticky Save Button (Mobile)
   ========================================================================== */
.sticky-save {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    padding: 1rem;
    box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.1);
    border-top: 1px solid var(--light);
    z-index: 9999;
}

.sticky-save button {
    position: relative;
    z-index: 10000;
    display: block;
    width: 100%;
}

@media (min-width: 768px) {
    .sticky-save {
        position: static;
        box-shadow: none;
        padding: 0;
        background: transparent;
        z-index: auto;
    }
    
    .sticky-save button {
        z-index: auto;
        width: auto;
    }
}

/* ==========================================================================
   File Upload Dropzone
   ========================================================================== */
.dropzone {
    border: 2px dashed var(--grey);
    border-radius: 0.75rem;
    padding: 2rem;
    text-align: center;
    transition: all 0.2s ease;
    cursor: pointer;
    background: var(--light);
    position: relative;
}

/* Ensure hidden file inputs in dropzones are accessible */
.dropzone input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* Ensure child elements don't block clicks */
.dropzone > * {
    pointer-events: none;
}

.dropzone > input[type="file"] {
    pointer-events: auto;
}

.dropzone:hover,
.dropzone.dragover {
    border-color: var(--primary);
    background-color: rgba(239, 65, 54, 0.05);
}

.dropzone.uploading {
    opacity: 0.7;
    pointer-events: none;
}

/* ==========================================================================
   File Gallery
   ========================================================================== */
.file-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
}

.file-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 0.5rem;
    overflow: hidden;
    background: var(--light);
    border: 1px solid var(--light);
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.file-item .file-icon {
    font-size: 2rem;
    color: var(--grey);
}

.file-item .file-actions {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    opacity: 0;
    transition: opacity 0.2s;
}

.file-item:hover .file-actions {
    opacity: 1;
}

/* ==========================================================================
   Inspiration URL List
   ========================================================================== */
.inspiration-item {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    padding: 1rem;
    background: var(--light);
    border: 1px solid var(--light);
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
}

.inspiration-item:last-child {
    margin-bottom: 0;
}

/* ==========================================================================
   Page List Cards
   ========================================================================== */
/* ==========================================================================
   Admin Dashboard Cards
   ========================================================================== */
.project-card {
    background: var(--white);
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--light);
    transition: all 0.2s ease;
}

.project-card:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.project-card.archived {
    opacity: 0.6;
    background: var(--light);
}

/* ==========================================================================
   Status Badges
   ========================================================================== */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
}

.status-badge.active {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
}

.status-badge.archived {
    background: var(--light);
    color: var(--grey);
}

.status-badge.complete {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
}

.status-badge.in-progress {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.status-badge.not-started {
    background: var(--light);
    color: var(--grey);
}

/* ==========================================================================
   Loading Spinner
   ========================================================================== */
.spinner {
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid var(--light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ==========================================================================
   Textarea Auto-resize
   ========================================================================== */
.auto-resize {
    min-height: 120px;
    resize: vertical;
}

/* ==========================================================================
   Form Inputs
   ========================================================================== */
input[type="text"],
input[type="email"],
input[type="url"],
input[type="tel"],
input[type="number"],
input[type="password"],
textarea,
select {
    background-color: var(--white);
    border-color: var(--light);
    color: var(--dark);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="url"]:focus,
input[type="tel"]:focus,
input[type="number"]:focus,
input[type="password"]:focus,
textarea:focus,
select:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 2px rgba(239, 65, 54, 0.2);
}

input::placeholder,
textarea::placeholder {
    color: var(--grey);
}

/* Labels */
label {
    color: var(--dark);
}

/* Checkboxes */
input[type="checkbox"] {
    background-color: var(--white);
    border-color: var(--grey);
}

/* ==========================================================================
   Typography
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
    color: var(--dark);
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */
.bg-dark {
    background-color: var(--dark);
}

.bg-light {
    background-color: var(--light);
}

.bg-primary {
    background-color: var(--primary);
}

.bg-secondary {
    background-color: var(--secondary);
}

.text-primary {
    color: var(--primary);
}

.text-dark {
    color: var(--dark);
}

.text-grey {
    color: var(--grey);
}

.border-primary {
    border-color: var(--primary);
}

/* ==========================================================================
   Mobile Optimizations
   ========================================================================== */
@media (max-width: 640px) {
    .form-section {
        padding: 1rem;
        border-radius: 0;
        margin-left: -1rem;
        margin-right: -1rem;
    }
    
    .file-gallery {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */
@media print {
    .no-print {
        display: none !important;
    }
}
