/* ITF Warehouse Kiosk Custom Styles */

/* Brand Colors */
:root {
    --itf-red: #ED3A23;
    --itf-dark: #0B1F2E;
    --itf-light: #F5F5F5;
    --itf-text-dark: #0B1F2E;
    --itf-text-gray: #4B5563;

    /* Fluid Typography System */
    --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
    --text-sm: clamp(0.875rem, 0.8rem + 0.375vw, 1rem);
    --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
    --text-lg: clamp(1.125rem, 1rem + 0.625vw, 1.5rem);
    --text-xl: clamp(1.25rem, 1.1rem + 0.75vw, 1.875rem);
    --text-2xl: clamp(1.5rem, 1.3rem + 1vw, 2.25rem);
    --text-3xl: clamp(1.875rem, 1.5rem + 1.875vw, 3rem);
}

/* Tailwind CSS Custom Colors */
.text-itf-red {
    color: var(--itf-red);
}

.text-itf-dark {
    color: var(--itf-dark);
}

.text-itf-light {
    color: var(--itf-light);
}

.bg-itf-red {
    background-color: var(--itf-red);
}

.bg-itf-dark {
    background-color: var(--itf-dark);
}

.bg-itf-light {
    background-color: var(--itf-light);
}

.border-itf-red {
    border-color: var(--itf-red);
}

.border-itf-dark {
    border-color: var(--itf-dark);
}

.focus\:ring-itf-red:focus {
    --tw-ring-color: var(--itf-red);
}

.focus\:ring-itf-dark:focus {
    --tw-ring-color: var(--itf-dark);
}

/* Custom Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

.pulse-animation {
    animation: pulse 2s infinite;
}

/* Form Enhancements */
.form-input {
    transition: all 0.3s ease;
}

.form-input:focus {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(237, 58, 35, 0.15);
}

.form-input.error {
    border-color: #EF4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-input.success {
    border-color: #10B981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* Button Enhancements */
.btn-primary {
    background-color: var(--itf-red);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-height: 56px;
    font-size: var(--text-lg);
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    width: 100%;
}

.btn-primary:hover:not(:disabled) {
    background-color: #C53030;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(237, 58, 35, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-secondary {
    background-color: var(--itf-dark);
    transition: all 0.3s ease;
    min-height: 48px;
    font-size: var(--text-base);
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
}

.btn-secondary:hover:not(:disabled) {
    background-color: #1E3A8A;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(11, 31, 46, 0.3);
}

.btn-secondary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Photo capture button specific styles */
.btn-photo-capture {
    min-height: 48px;
    font-size: var(--text-base);
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    letter-spacing: 0.025em;
    box-shadow: 0 1px 4px rgba(237, 58, 35, 0.15);
    border: 1px solid rgba(237, 58, 35, 0.1);
    background: linear-gradient(135deg, var(--itf-red), #C53030);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.btn-photo-capture:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(237, 58, 35, 0.25);
    background: linear-gradient(135deg, #C53030, var(--itf-red));
}

.btn-photo-capture:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(237, 58, 35, 0.15);
}

/* Retake photo button - lighter color */
.btn-retake {
    background-color: #6B7280;
    transition: all 0.3s ease;
}

.btn-retake:hover:not(:disabled) {
    background-color: #4B5563;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(107, 114, 128, 0.3);
}

/* Lighter secondary button for alternative actions */
.btn-secondary-light {
    background-color: #6B7280;
    transition: all 0.3s ease;
    min-height: 48px;
    font-size: var(--text-base);
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    color: white;
}

.btn-secondary-light:hover:not(:disabled) {
    background-color: #4B5563;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(107, 114, 128, 0.3);
}

.btn-secondary-light:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Button spacing for mobile */
@media (max-width: 767px) {
    .btn-primary + .btn-primary,
    .btn-secondary + .btn-secondary {
        margin-top: 1rem;
    }
}

/* Tablet+ button sizes */
@media (min-width: 768px) {
    .btn-primary {
        min-height: 64px;
        font-size: var(--text-xl);
        width: auto;
        max-width: 400px;
    }

    .btn-secondary {
        min-height: 56px;
        font-size: var(--text-lg);
    }

    .btn-photo-capture {
        min-height: 72px;
        font-size: var(--text-2xl);
    }
}

/* Card Enhancements */
.card {
    transition: all 0.3s ease;
    border: 1px solid #E5E7EB;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border-color: var(--itf-red);
}

/* Photo Upload Area */
.photo-upload-area {
    transition: all 0.3s ease;
    border: 2px dashed #D1D5DB;
}

.photo-upload-area:hover {
    border-color: var(--itf-red);
    background-color: rgba(237, 58, 35, 0.05);
}

.photo-upload-area.dragover {
    border-color: var(--itf-red);
    background-color: rgba(237, 58, 35, 0.1);
    transform: scale(1.02);
}

/* Loading States */
.loading-spinner {
    border: 3px solid #F3F4F6;
    border-top: 3px solid var(--itf-red);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

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

/* Success/Error States */
.success-message {
    background: linear-gradient(135deg, #10B981, #059669);
    color: white;
    padding: 1rem;
    border-radius: 0.5rem;
    margin: 1rem 0;
    animation: slideIn 0.3s ease-out;
}

.error-message {
    background: linear-gradient(135deg, #EF4444, #DC2626);
    color: white;
    padding: 1rem;
    border-radius: 0.5rem;
    margin: 1rem 0;
    animation: slideIn 0.3s ease-out;
}

/* Modal Enhancements */
.modal {
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    animation: slideIn 0.3s ease-out;
    transform-origin: center;
}

/* Responsive Design */
@media (max-width: 768px) {
    .card {
        margin: 0.5rem;
    }

    .btn-primary,
    .btn-secondary {
        padding: 0.75rem 1.5rem;
        font-size: var(--text-base);
        min-height: 56px;
    }

    .form-input {
        padding: 1rem;
        font-size: var(--text-base);
    }

    /* Apply fluid typography to headings */
    h1 { font-size: var(--text-lg); }
    h2 { font-size: var(--text-base); }
    h3 { font-size: var(--text-sm); }
    label { font-size: var(--text-sm); }
    p { font-size: var(--text-sm); }
}

/* Tablet styles */
@media (min-width: 768px) {
    h1 { font-size: var(--text-xl); }
    h2 { font-size: var(--text-lg); }
    h3 { font-size: var(--text-base); }
    label { font-size: var(--text-sm); }
    p { font-size: var(--text-base); }
}

/* Desktop/Kiosk styles */
@media (min-width: 1024px) {
    h1 { font-size: var(--text-2xl); }
    h2 { font-size: var(--text-xl); }
    h3 { font-size: var(--text-lg); }
    label { font-size: var(--text-base); }
    p { font-size: var(--text-base); }
}

/* Large Kiosk styles */
@media (min-width: 1280px) {
    h1 { font-size: var(--text-3xl); }
    h2 { font-size: var(--text-2xl); }
    h3 { font-size: var(--text-xl); }
    label { font-size: var(--text-lg); }
    p { font-size: var(--text-lg); }
}

/* Accessibility */
.focus-visible:focus {
    outline: 2px solid var(--itf-red);
    outline-offset: 2px;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --itf-red: #CC0000;
        --itf-dark: #000000;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #000;
    }
}

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

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

::-webkit-scrollbar-thumb {
    background: var(--itf-red);
    border-radius: 4px;
}

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

/* Utility Classes */
.text-shadow {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.box-shadow-lg {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.box-shadow-xl {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* Form Validation Styles */
.field-error {
    color: #EF4444;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.field-success {
    color: #10B981;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Photo Preview Styles */
.photo-preview {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Duration Display */
.duration-display {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    color: var(--itf-red);
}

/* Status Indicators */
.status-on-site {
    color: #F59E0B;
    font-weight: bold;
}

.status-checked-out {
    color: #10B981;
    font-weight: bold;
}

/* Dashboard Specific Styles */
.metric-card {
    background: linear-gradient(135deg, #FFFFFF, #F8FAFC);
    border: 1px solid #E2E8F0;
    transition: all 0.3s ease;
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.metric-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--itf-red);
}

.metric-label {
    color: var(--itf-text-gray);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Custom Select Dropdown */
select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

/* Tablet Landscape Optimization */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {
    /* Optimize for tablet landscape */
    .form-input {
        font-size: var(--text-lg);
    }
    main {
        padding-top: 1rem;
        padding-bottom: 1rem;
    }
    .modal-content {
        max-width: 80vw;
    }
    .card {
        padding: 1.5rem;
    }
    h1 {
        font-size: var(--text-2xl);
    }
    h2 {
        font-size: var(--text-xl);
    }

    /* Fix back button arrow alignment on tablets */
    header button.inline-flex {
        min-height: 40px;
        align-items: center;
    }
}
