@tailwind base;
@tailwind components;
@tailwind utilities;

/* =========================
   GLOBAL
========================= */

html,
body {
    scroll-behavior: smooth;
    font-family: "Inter", sans-serif;
    background: #f8fafc;
}

/* =========================
   AI PAGE WRAPPER
========================= */

.ai-wrapper {
    position: relative;
    overflow: hidden;
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(251, 191, 36, 0.08), transparent 25%),
        radial-gradient(circle at bottom right, rgba(245, 158, 11, 0.08), transparent 25%),
        #f8fafc;
}

/* Floating blur */
.ai-wrapper::before {
    content: "";
    position: absolute;
    top: -120px;
    left: -120px;
    width: 320px;
    height: 320px;
    background: rgba(251, 191, 36, 0.15);
    filter: blur(100px);
    border-radius: 999px;
    z-index: 0;
}

.ai-wrapper::after {
    content: "";
    position: absolute;
    bottom: -120px;
    right: -120px;
    width: 320px;
    height: 320px;
    background: rgba(249, 115, 22, 0.12);
    filter: blur(100px);
    border-radius: 999px;
    z-index: 0;
}

/* =========================
   GLASS CARD
========================= */

.ai-card {
    position: relative;
    z-index: 2;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);

    border: 1px solid rgba(255, 255, 255, 0.5);

    box-shadow:
        0 10px 30px rgba(15, 23, 42, 0.06),
        inset 0 1px 1px rgba(255, 255, 255, 0.6);

    border-radius: 32px;

    transition: all 0.3s ease;
}

.ai-card:hover {
    transform: translateY(-2px);
    box-shadow:
        0 18px 45px rgba(15, 23, 42, 0.08),
        inset 0 1px 1px rgba(255, 255, 255, 0.7);
}

/* =========================
   HEADINGS
========================= */

.ai-title {
    font-size: 54px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: -2px;
    color: #0f172a;
}

.ai-subtitle {
    color: #64748b;
    font-size: 16px;
    line-height: 28px;
}

/* =========================
   PREMIUM BADGE
========================= */

.ai-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;

    padding: 10px 18px;

    background: linear-gradient(
        135deg,
        rgba(251, 191, 36, 0.18),
        rgba(245, 158, 11, 0.1)
    );

    color: #92400e;

    border: 1px solid rgba(251, 191, 36, 0.25);

    border-radius: 999px;

    font-size: 13px;
    font-weight: 700;

    backdrop-filter: blur(10px);
}

/* =========================
   INPUTS
========================= */

.ai-input,
.ai-select,
.ai-textarea {
    width: 100%;

    border: 1px solid #e2e8f0;

    background: rgba(255, 255, 255, 0.85);

    border-radius: 22px;

    padding: 16px 18px;

    color: #0f172a;

    font-size: 15px;

    transition: all 0.25s ease;

    outline: none;

    box-shadow:
        inset 0 1px 2px rgba(15, 23, 42, 0.03);
}

.ai-input::placeholder,
.ai-textarea::placeholder {
    color: #94a3b8;
}

.ai-input:hover,
.ai-select:hover,
.ai-textarea:hover {
    border-color: #cbd5e1;
}

.ai-input:focus,
.ai-select:focus,
.ai-textarea:focus {
    border-color: #f59e0b;

    box-shadow:
        0 0 0 4px rgba(251, 191, 36, 0.15),
        inset 0 1px 2px rgba(15, 23, 42, 0.03);

    background: #fff;
}

.ai-textarea {
    resize: none;
    min-height: 180px;
}

/* =========================
   FILE INPUT
========================= */

.ai-file {
    width: 100%;

    border: 2px dashed #dbeafe;

    background: linear-gradient(
        to bottom,
        rgba(255,255,255,0.8),
        rgba(248,250,252,0.95)
    );

    border-radius: 24px;

    padding: 24px;

    transition: all 0.3s ease;
}

.ai-file:hover {
    border-color: #f59e0b;
    background: white;
}

.ai-file input[type="file"] {
    width: 100%;
}

/* =========================
   BUTTON
========================= */

.ai-button {
    position: relative;

    overflow: hidden;

    width: 100%;

    border: none;

    border-radius: 24px;

    padding: 18px 24px;

    font-size: 16px;
    font-weight: 700;

    color: white;

    background: linear-gradient(
        135deg,
        #111827,
        #1e293b
    );

    transition: all 0.35s ease;

    cursor: pointer;

    box-shadow:
        0 10px 25px rgba(15, 23, 42, 0.18);
}

.ai-button::before {
    content: "";

    position: absolute;
    top: 0;
    left: -120%;

    width: 100%;
    height: 100%;

    background: linear-gradient(
        120deg,
        transparent,
        rgba(255,255,255,0.25),
        transparent
    );

    transition: all 0.6s ease;
}

.ai-button:hover::before {
    left: 120%;
}

.ai-button:hover {
    transform: translateY(-2px);

    box-shadow:
        0 16px 35px rgba(15, 23, 42, 0.22);
}

.ai-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* =========================
   RESULT PANEL
========================= */

.ai-result-box {
    position: relative;

    overflow: hidden;

    min-height: 540px;

    border-radius: 32px;

    border: 1px dashed #dbeafe;

    background:
        linear-gradient(
            to bottom right,
            rgba(255,255,255,0.95),
            rgba(248,250,252,0.95)
        );

    display: flex;
    align-items: center;
    justify-content: center;

    transition: all 0.3s ease;
}

.ai-result-box:hover {
    border-color: #f59e0b;
}

.ai-result-image {
    width: 100%;
    height: auto;

    border-radius: 30px;

    object-fit: cover;

    box-shadow:
        0 15px 40px rgba(15, 23, 42, 0.12);
}

/* =========================
   LOADER
========================= */

.ai-loader {
    width: 60px;
    height: 60px;

    border-radius: 999px;

    border: 5px solid rgba(15, 23, 42, 0.08);

    border-top-color: #f59e0b;

    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* =========================
   IMAGE PREVIEW
========================= */

.ai-preview {
    width: 100%;
    height: 260px;

    object-fit: cover;

    border-radius: 24px;

    border: 1px solid #e2e8f0;

    margin-top: 16px;

    box-shadow:
        0 10px 30px rgba(15, 23, 42, 0.06);
}

/* =========================
   LABELS
========================= */

.ai-label {
    display: block;

    margin-bottom: 10px;

    color: #334155;

    font-size: 14px;

    font-weight: 600;
}

/* =========================
   SMALL TEXT
========================= */

.ai-helper {
    margin-top: 10px;

    color: #94a3b8;

    font-size: 13px;
}

/* =========================
   MODEL STATUS
========================= */

.ai-model-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 10px 16px;

    border-radius: 999px;

    background: rgba(15, 23, 42, 0.05);

    color: #0f172a;

    font-size: 13px;
    font-weight: 700;

    border: 1px solid rgba(15, 23, 42, 0.06);
}

/* =========================
   DOWNLOAD BUTTON
========================= */

.ai-download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 12px 18px;

    border-radius: 999px;

    background: rgba(251, 191, 36, 0.14);

    color: #92400e;

    font-size: 13px;
    font-weight: 700;

    border: 1px solid rgba(251, 191, 36, 0.25);

    transition: all 0.25s ease;
}

.ai-download-btn:hover {
    transform: translateY(-2px);
    background: rgba(251, 191, 36, 0.22);
}

/* =========================
   ERROR BOX
========================= */

.ai-error {
    border-radius: 22px;

    background: rgba(254, 242, 242, 0.9);

    border: 1px solid rgba(248, 113, 113, 0.2);

    color: #b91c1c;

    padding: 16px 18px;

    font-size: 14px;
}

/* =========================
   RESPONSIVE
========================= */

@media (max-width: 768px) {
    .ai-title {
        font-size: 38px;
        line-height: 1.1;
    }

    .ai-card {
        border-radius: 26px;
    }

    .ai-result-box {
        min-height: 420px;
    }
}
.ai-header {
    text-align: center;
    margin-bottom: 50px;
}

.ai-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.ai-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.ai-field {
    margin-bottom: 20px;
}

.ai-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 30px;
    gap: 20px;
}

.ai-top h2 {
    font-size: 28px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 5px;
}

.ai-top p {
    color: #64748b;
}

.ai-center {
    text-align: center;
}

.ai-icon {
    width: 70px;
    height: 70px;
    margin: auto;
    margin-bottom: 20px;
    border-radius: 22px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
}

.hidden {
    display: none !important;
}

@media(max-width: 992px) {

    .ai-grid {
        grid-template-columns: 1fr;
    }

    .ai-row {
        grid-template-columns: 1fr;
    }

}
/* Update your ai-crockery.css with these specific tweaks */

.ai-wrapper {
    background: radial-gradient(circle at top right, #fffbeb, #f8fafc);
    padding: 60px 20px;
}

.p-40 { padding: 40px; }

/* Fixed visibility helper */
.hidden { display: none !important; }

/* The container that holds the output image */
.result-container {
    position: relative;
    width: 100%;
    min-height: 500px;
    background: #f1f5f9;
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.ai-result-content {
    text-align: center;
    padding: 20px;
}

.ai-result-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    animation: fadeIn 0.8s ease-out;
}

/* Reference image preview inside the upload box */
#refPreview {
    max-height: 80px;
    border-radius: 12px;
    margin-top: 10px;
    border: 2px solid white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.ai-file-wrapper {
    border: 2px dashed #e2e8f0;
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    position: relative;
    transition: 0.3s;
}

.ai-file-wrapper:hover {
    border-color: #fbbf24;
    background: #fffdfa;
}

.ai-file-wrapper input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

/* Premium Button */
.ai-button {
    background: #0f172a;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-size: 14px;
}

.ai-button:hover {
    background: #1e293b;
    transform: translateY(-2px);
}
