/* General Styling */
body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f9;
    margin: 0;
    padding: 20px;
    color: #333;
    text-align: center;
}

h1, h2 {
    margin: 20px 0;
}

/* Title & Subtitle Styling */
.title {
    font-family: 'Dancing Script', cursive;
    font-size: 48px;
    font-weight: 700;
    text-align: center;
    color: black;
}

.subtitle {
    font-family: Arial, sans-serif;
    font-size: 18px;
    font-weight: 400;
    text-align: center;
    color: gray;
}

/* Upload Section */
.upload-section {
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

/* Drop Zone */
.drop-zone {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 10px;
    padding: 10px;
    justify-content: center;
    align-items: center;
    max-width: 100%;
    border: 2px dashed #ccc;
    min-height: 150px;
    white-space: nowrap;
    transition: box-shadow 0.1s ease-in-out, border-color 0.1s ease-in-out;
}

.drop-zone:hover {
    box-shadow: 0px 0px 20px rgba(155, 89, 182, 0.8);
    border-color: rgba(155, 89, 182, 0.8);
}

.drop-zone img {
    max-height: 150px;
    object-fit: contain;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 5px;
}

.drop-zone img:hover {
    transform: scale(1.05);
}

.drop-zone.dragover {
    background: #f0f0f0;
    box-shadow: 0px 0px 20px rgba(155, 89, 182, 0.8);
    border-color: rgba(155, 89, 182, 0.8);
}

/* Preview Container */
.preview-container {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 10px 0;
    justify-content: center;
    align-items: center;
}

.preview-container img {
    max-width: 200px;
    border: 1px solid #ccc;
    border-radius: 5px;
    transition: transform 0.2s ease;
    margin: 5px;
}

.preview-container img:hover {
    transform: scale(1.05);
}

/* Buttons & Select Elements */
button {
    background: #007bff;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease;
    margin: 5px;
}

button:hover {
    background: #0056b3;
}

select {
    background: white;
    color: #333;
    border: 1px solid #ccc;
    padding: 8px;
    border-radius: 5px;
    cursor: pointer;
    transition: border 0.3s ease;
}

select:hover {
    border-color: #007bff;
}

/* Loading Spinner */
.loading {
    display: none;
    text-align: center;
    margin: 20px 0;
}

.loading-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

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

/* Image Card */
.image-card {
    position: relative;
    width: 150px;
    background: white;
    padding: 10px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    text-align: center;
}

.image-card img {
    max-width: 100%;
    border-radius: 5px;
}

/* Popup */
.popup {
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 245, 245, 0.9);
    border-radius: 16px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(8.2px);
    z-index: 1000;
    max-width: 90%;  /* Prevents it from stretching too wide */
    max-height: 90vh; /* Limits height to fit the screen */
    overflow: hidden;  /* Ensures no unwanted scrollbars */
    padding: 20px;
    text-align: center; /* Centers everything inside */
}

.popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}
#popupImage {
    max-width: 100%;   /* Ensures image doesn't exceed popup width */
    max-height: 80vh;  /* Prevents image from exceeding 80% of viewport height */
    display: block;    /* Removes any extra space */
    margin: 0 auto;    /* Centers the image */
    border-radius: 10px; /* Optional: rounded corners for a cleaner look */
    object-fit: contain; /* Ensures the image scales properly */
}


.close-btn {
    margin-top: 10px;
    background: red;
    color: white;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
    border-radius: 5px;
}

.close-btn:hover {
    background: darkred;
}

/* Twibbon Preview */
.twibbon-preview {
    position: relative; /* Ensures delete button is positioned relative to this */
    display: inline-block;
    max-width: 200px; 
}

.twibbon-preview img {
    max-width: 200px;
    max-height: 200px;
    cursor: pointer;
    border: 2px solid #ddd;
    border-radius: 10px;
    padding: 5px;
    transition: 0.3s;
}

.twibbon-preview {
    display: flex;
    flex-direction: column;
    align-items: center; /* Centers everything */
    justify-content: center;
    margin-top: 20px;
    position: relative;
  }
  
  #twibbonPreview {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
  }
  #twibbonPreviewContainer {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    margin: 20px auto; /* Center the preview */
    width: fit-content;
    text-align: center;
    }
  #deleteTwibbon {
    background-color: #fff;
    border: 2px solid #333;
    border-radius: 10px;
    width: 30px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.3s;
    position: absolute;
    bottom: -30px; /* Moves it closer to the preview */
    left: 50%;
    transform: translateX(-50%);
    opacity: 0.3; 
  }
  
  #deleteTwibbon::before {
    content: "✖";
    font-size: 20px;
    color: #333;
  }
  
  #deleteTwibbon:hover {
    opacity: 1;
    background-color: #f0f0f0;
  }
  
