:root {
    --primary-color: #231F20;
    --secondary-color: #656565;
    --accent-color: #000000;
    --bg-color: #ffffff;
    --surface-color: #f8f9fa;
    --border-color: #e5e5e5;
    --border-hover: #231F20;
    --success-color: #198754;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 24px;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--primary-color);
    background-color: var(--bg-color);
    -webkit-font-smoothing: antialiased;
    line-height: 1.6;
}

.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.footer {
    background-color: var(--primary-color);
    color: #fff;
    padding: 0.8rem 0;
    margin-top: auto;
    position: fixed;
    bottom: 0;
    width: 100%;
    z-index: 1000;
}

h1, h2, h3, h4, h5, h6 {
    letter-spacing: -0.02em;
}

.section-title {
    font-weight: 700;
    color: var(--primary-color);
    position: relative;
    padding-left: 1rem;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    font-size: 1.5rem;
    letter-spacing: 0.05em;
}

.section-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 34px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

.section-title-2 {
    font-weight: 700;
    color: var(--primary-color);
    position: relative;
    padding-left: 1rem;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
}

.section-title-2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 24px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

/* Header */
.header {
    border-bottom: 1px solid var(--border-color) !important;
    background: var(--primary-color);
    color: #ffffff;
    padding-top: 1.5rem !important;
    padding-bottom: 1.5rem !important;
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 1000;
}

.header h1 {
    color: #ffffff !important;
}

.header .border-bottom {
    border-bottom: none !important;
}

/* Upload Zone */
.upload-zone {
    border: 2px dashed #d0d0d0;
    border-radius: var(--radius-lg);
    height: 180px;
    background-color: var(--bg-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.shake-error {
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
    border-color: #dc3545 !important; /* Bootstrap danger color */
    background-color: rgba(220, 53, 69, 0.05) !important;
    transition: none !important; /* Prevent transition from fighting animation */
}


.shake-error .bi-cloud-arrow-up {
    color: #dc3545 !important;
    transition: none !important;
}

.upload-zone:hover {
    border-color: var(--border-hover);
    background-color: var(--surface-color);
    transform: translateY(-2px);
}

.upload-zone.dragover {
    border-color: var(--primary-color);
    background-color: var(--surface-color);
    transform: scale(0.99);
}

.icon-circle {
    width: 64px;
    height: 64px;
    background-color: var(--surface-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    transition: transform 0.3s ease;
}

.upload-zone:hover .icon-circle {
    transform: scale(1.1);
    background-color: #fff;
    box-shadow: var(--shadow-sm);
}

.bi-cloud-arrow-up {
    color: var(--primary-color);
}

/* Buttons */
.btn {
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-outline-dark {
    border: 1.5px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline-dark:hover {
    background-color: var(--primary-color);
    color: #fff;
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.btn-dark {
    background-color: var(--primary-color);
    border: 1.5px solid var(--primary-color);
}

.btn-dark:hover {
    background-color: #000;
    border-color: #000;
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0) !important;
}

/* Thumbnails */
.thumbnail-card {
    height: 20dvh;
    background-color: #fff;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.thumbnail-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
    transform: translateY(-5px);
}

.thumbnail-card img {
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.thumbnail-card:hover img {
    transform: scale(1.05);
}

/* Preview Area */
.preview-container {
    background-color: var(--surface-color);
    height: 50dvh; /* Fixed height to prevent layout shifts */
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: inset 0 0 40px rgba(0,0,0,0.02);
}

.preview-container .btn-light {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0,0,0,0.1);
    backdrop-filter: blur(4px);
}

.preview-container .btn-light:hover {
    background: #fff;
    transform: scale(1.1);
}

/* Utilities */
.object-fit-scale-down {
    object-fit: scale-down;
}

/* Utilities */
.text-muted {
    color: var(--secondary-color) !important;
}

.dashed-border {
    border-style: dashed !important; /* Re-enforce utility */
}

/* Modal */
.modal-fullscreen .modal-content {
    background-color: #000;
}

.modal-backdrop.show {
    opacity: 0.8;
}

/* Animation */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.animate-pulse {
    animation: pulse 2s infinite ease-in-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate3d(0, 20px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.5s ease-out forwards;
}

/* Custom Loader */
.ai-loader {
    width: 48px;
    height: 48px;
    border: 5px solid var(--surface-color);
    border-bottom-color: var(--primary-color);
    border-radius: 50%;
    display: inline-block;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
}

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

/* Shimmer Effect */
.shimmer {
    background: #f6f7f8;
    background-image: linear-gradient(to right, #f6f7f8 0%, #edeef1 20%, #f6f7f8 40%, #f6f7f8 100%);
    background-repeat: no-repeat;
    background-size: 800px 104px; 
    display: inline-block;
    position: relative; 
    animation-duration: 1s;
    animation-fill-mode: forwards; 
    animation-iteration-count: infinite;
    animation-name: placeholderShimmer;
    animation-timing-function: linear;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}


@keyframes fadeOutDown {
    from {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
    to {
        opacity: 0;
        transform: translate3d(0, 20px, 0);
    }
}

.fade-out-down {
    animation: fadeOutDown 0.3s ease-in forwards;
}