/* =========================================================== */
/* PART 1: IMPROVED STORY VIEWER (INSTAGRAM STYLE)             */
/* =========================================================== */

/* Global persistent story overlay */
.str-global-story-overlay {
  z-index: 11990 !important;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  height: 100%;
  width: 100%;
  background-color: #000000;
  opacity: 0;
  display: none;
  transition: opacity 0.4s ease;
  pointer-events: auto;
}

.str-global-story-overlay.active {
  display: block !important;
  opacity: 0.85 !important;
  visibility: visible !important;
  pointer-events: auto;
}

/* Hide individual story overlays */
.str-storybox .story-cover {
  display: none !important;
}

/* Visibility fixes */
.str-storybox .storytime,
.str-storybox .story-window,
.str-storybox .story-video,
.str-storybox .story-img,
.str-storybox .story-like-btn,
.str-storybox .str-do-like,
.str-storybox .str-like-animation,
.str-storybox .str-like-animation svg {
  overflow: visible !important;
}

.str-storybox {
  position: relative;
  z-index: 12000;
}

.str-storybox .storytime {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100dvh !important;
  z-index: 12000 !important;
  visibility: hidden;
  pointer-events: none;
}

.str-storybox .storytime.is-open {
  visibility: visible !important;
  pointer-events: auto !important;
}

.str-storybox .story-like-btn {
  z-index: 999 !important;
}

.str-storybox .str-like-animation {
  width: 54px !important;
  height: 54px !important;
  margin: -20px -18px -18px -13px !important;
  display: inline-block !important;
  flex-shrink: 0;
  pointer-events: none;
  vertical-align: middle;
  position: relative;
  z-index: 1000 !important;
}

/* USER INFO HEADER */
.str-storybox .story-nav {
  display: flex;
  width: 100%;
  padding: 0 8px;
}

.str-storybox .story-nav-left {
  height: 6vh;
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  color: #ffffff;
  width: calc(100% - 50px);
  margin: 0;
  padding: 0;
}

.str-storybox .story-nav-left a {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.str-storybox .story-icon {
  height: 42px;
  width: 42px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid #ffffff;
  flex-shrink: 0;
}

.str-storybox .story-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.str-storybox span.story-text {
  font-weight: 600;
  font-size: 16px;
  line-height: 1.3;
  color: #fff;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  width: 230px;
  max-width: 100%;
  display: block;
}

.str-storybox span.story-text a {
  color: #fff;
  text-decoration: none;
}

.str-storybox span.story-date {
  font-size: 13px;
  line-height: 1.3;
  color: rgba(255, 255, 255, 0.8);
  opacity: 1;
  font-weight: normal;
}

.str-storybox .story-nav-right {
  height: 6vh;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  width: 50px;
  margin: 0;
  padding: 0;
}

/* TIMELINE */
.str-storybox .story-timeline {
  height: 3vh;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 4px;
  padding: 0 8px;
}

.str-storybox .story-timeline-item {
  flex-grow: 1;
  height: 2px;
  position: relative;
  margin: 0;
}

.str-storybox .story-timeline-line {
  background: rgba(255, 255, 255, 0.35);
  border-radius: 2px;
  height: 2px;
  position: absolute;
  top: 0;
  width: 100%;
}

.str-storybox .story-timeline-line-active {
  transition: width 0.25s linear;
  border-radius: 2px;
  height: 2px;
  position: absolute;
  top: 0;
  background: #ffffff;
}

/* STORY WINDOW */
.str-storybox .story-window {
  z-index: 12010 !important;
  position: fixed !important;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  max-height: 90%;
  display: flex;
  flex-direction: column;
}

@media screen and (max-width: 480px) {
 .str-storybox .story-window {
    top: 50%;
    width: min(100vw, 420px);
    max-width: 100vw;
    max-height: 100dvh;
  }
}

.str-storybox .story-video,
.str-storybox .story-img {
  position: relative;
  display: block;
  height: 80vh;
  min-width: 240px;
  aspect-ratio: 9/16;
  width: 100%;
  object-fit: cover;
  background-color: #000000;
}

.str-storybox .story-img {
  display: none;
  max-width: 90vh;
  align-items: center;
  justify-content: center;
}

.str-storybox .story-video video {
  aspect-ratio: 9/16;
  width: 100%;
  object-fit: cover;
  display: inline-block;
  vertical-align: middle;
  position: relative;
}

/* HIDE NATIVE VIDEO CONTROLS */
.str-storybox .story-video video::-webkit-media-controls,
.str-storybox .story-video video::-webkit-media-controls-enclosure,
.str-storybox .story-video video::-webkit-media-controls-panel,
.str-storybox .story-video video::--webkit-media-controls-play-button,
.str-storybox .story-video video::-webkit-media-controls-start-playback-button {
  display: none !important;
}

.str-storybox .story-img img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: cover;
  aspect-ratio: 9/16;
}

/* STATS (VIEWS & LIKES) */
.str-storybox .story-views {
  position: absolute;
  bottom: 20px;
  left: 20px;
  z-index: 15;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  padding: 10px 16px;
  border-radius: 20px;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
}

.str-storybox .story-views i {
  font-size: 18px;
}

.str-storybox .story-like-btn {
  position: absolute;
  bottom: 20px;
  right: 20px;
  z-index: 15;
}

.str-storybox .str-do-like {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  padding: 10px 16px;
  border-radius: 20px;
  transition: all 0.2s ease;
  text-decoration: none;
  overflow: visible !important;
  transform-origin: center center !important; 
  position: relative;
}

.str-storybox .str-do-like:hover {
  background: rgba(0, 0, 0, 0.8);
  transform: scale(1.05);
  text-decoration: none;
}

.str-storybox .str-do-like span {
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  position: relative;
  z-index: 2;
}

.str-storybox .str-do-like.str-disabled {
  opacity: 0.5;
  pointer-events: none;
}

@keyframes heartBeat {
  0%, 100% { transform: scale(1); }
  25% { transform: scale(1.3); }
  50% { transform: scale(1.1); }
}

/* CONTROLS (AUDIO & PLAY) */
.str-storybox .story-audio-control {
  position: absolute;
  top: calc(9vh + 10px);
  left: 15px;
  z-index: 20;
  width: 40px;
  height: 40px;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.str-storybox .str-do-like i.fa {
  display: none !important;
}

.str-storybox .story-audio-control:hover,
.str-storybox .story-play-control:hover {
  background: rgba(0, 0, 0, 0.7);
  transform: scale(1.1);
}

.str-storybox .story-audio-control i,
.str-storybox .story-play-control i {
  color: #fff;
  font-size: 18px;
}

.str-storybox .story-play-control {
  position: absolute;
  top: calc(9vh + 10px);
  right: 15px;
  z-index: 20;
  width: 40px;
  height: 40px;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

/* ARROWS & CLOSE */
.str-storybox .story-arrow {
  border: solid #ffffff;
  border-width: 0 3px 3px 0;
  display: block;
  padding: 15px;
  opacity: 0.3;
  transition: opacity 0.2s;
  z-index: 12;
}

.str-storybox .story-arrow:hover {
  opacity: 0.9;
}

.str-storybox .right {
  position: absolute;
  right: -12%;
  top: 50%;
  transform: rotate(-45deg);
}

.str-storybox .left {
  position: absolute;
  left: -12%;
  top: 50%;
  transform: rotate(135deg);
}

.str-storybox .close {
  position: relative;
  width: 32px;
  height: 32px;
  opacity: 0.7;
  transition: opacity 0.2s;
  cursor: pointer;
  right: 3px;	
}

.str-storybox .close:hover {
  opacity: 1;
}

.str-storybox .close:before,
.str-storybox .close:after {
  position: absolute;
  left: 15px;
  content: ' ';
  height: 24px;
  width: 2px;
  background-color: #ffffff;
}

.str-storybox .close:before { transform: rotate(45deg); }
.str-storybox .close:after { transform: rotate(-45deg); }

/* SPINNER */
.str-storybox .spinner {
  width: 70px;
  text-align: center;
  margin: auto;
  position: absolute;
  left: 50%;
  top: 50%;
  margin-left: -35px;
  margin-top: -20px;
  z-index: 50;
}

.str-storybox .spinner > div {
  width: 18px;
  height: 18px;
  background-color: #fff;
  border-radius: 100%;
  display: inline-block;
  animation: st-sk-bouncedelay 1.4s infinite ease-in-out both;
}

.str-storybox .spinner .bounce1 { animation-delay: -0.32s; }
.str-storybox .spinner .bounce2 { animation-delay: -0.16s; }

@keyframes st-sk-bouncedelay {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1.0); }
}

@media screen and (max-width: 768px) {
  .str-storybox .story-arrow { display: none; }
  .str-storybox .story-audio-control,
  .str-storybox .story-play-control { width: 36px; height: 36px; }
  .str-storybox .story-audio-control i,
  .str-storybox .story-play-control i { font-size: 16px; }
  .str-storybox .story-views,
  .str-storybox .str-do-like { padding: 8px 12px; font-size: 14px; }
  .str-storybox .story-icon { height: 36px; width: 36px; }
  .str-storybox span.story-text { font-size: 14px; }
  .str-storybox span.story-date { font-size: 12px; }
}


/* =========================================================== */
/* PART 2: NEW STORY STUDIO DASHBOARD STYLES (MODERN GRID)     */
/* =========================================================== */

/* CORE VARIABLES */
:root {
    --str-primary: #FE4365;
    --str-primary-hover: #e31c5f;
    --str-bg: #f8f9fc;
    --str-card-bg: #ffffff;
    --str-text-dark: #2d3748;
    --str-text-light: #718096;
    --str-shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --str-shadow-md: 0 8px 16px rgba(0,0,0,0.08);
    --str-radius: 16px;
    --str-font: "CircularXXWeb-Medium", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* RESET & LAYOUT */
#str-user.str-body, 
#str-item.str-body,
#str-edit-story.str-body {
   
    font-family: var(--str-font);
    color: var(--str-text-dark);

    display: block;
    width: 100%;
    box-sizing: border-box;
    border-radius: var(--str-radius);
    min-height: 400px;
}

#str-user *, #str-item *, #str-edit-story * {
    box-sizing: border-box;
}

/* HEADERS */
.str-item-header {
    margin-top: 1.5rem;
    padding-bottom: 1.5rem;
}
 .str-dashboard-header {
}

.str-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* CHANGED: Replaced 'h1' selector with specific class to avoid theme inheritance */
.str-item-header h2, 
.str-dashboard-header .str-page-title {
    font-size: 1.5rem;
    color: var(--str-text-dark);
    margin: 0;
    font-weight: 700;
    line-height: 1.2;
    text-shadow: none !important; /* Safety reset */
    font-family: var(--str-font);
}

/* BUTTON: VIEW PROFILE */
.str-item-header .item-link, 
.btn-view-profile {
    font-size: 0.9rem;
    color: var(--str-primary);
    text-decoration: none;
    font-weight: 600;
    background: #fff5f7;
    padding: 8px 16px;
    border-radius: 20px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.str-item-header .item-link:hover, 
.btn-view-profile:hover {
    background: var(--str-primary);
    color: #ffffff !important; /* FORCED WHITE TEXT ON HOVER */
    text-decoration: none;
}

/* STATS BAR */
.str-stats-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    width: 100%;
    margin-bottom: 2rem;
    margin-top: 1.5rem;
}

.str-stat-card {
    background: #fff;
    padding: 1.25rem;
    border-radius: var(--str-radius);
    display: flex;
    flex-direction: column;
    position: relative;
    border: 1px solid #edf2f7;
    box-shadow: 0 2px 5px rgba(0,0,0,0.03);
}

.str-stat-card .label {
    font-size: 0.75rem;
    color: var(--str-text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.str-stat-card .value {
    font-size: 1.75rem;
    color: var(--str-text-dark);
    font-weight: 800;
    line-height: 1.2;
}

.str-stat-card .limit {
    font-size: 1rem;
    color: var(--str-text-light);
    font-weight: 500;
}

/* GRID LAYOUT */
.str-grid-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.5rem;
    width: 100%;
}

/* CARD: CREATE NEW */
.str-card.create-new {
    background-color: #fff;
    border: 2px dashed #cbd5e0;
    border-radius: var(--str-radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    aspect-ratio: 9 / 16;
    min-height: 380px;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    text-align: center;
    padding: 1rem;
}

.str-card.create-new:not(.disabled):hover {
    border-color: var(--str-primary);
    background-color: #fff5f7;
    transform: translateY(-4px);
}

.str-card.create-new .icon-circle {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--str-primary), var(--str-primary-hover));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    box-shadow: 0 4px 12px rgba(254, 67, 101, 0.3);
    color: white;
    font-size: 24px;
}

.str-card.create-new .cta-text {
    color: var(--str-text-dark);
    font-weight: 700;
    font-size: 1.1rem;
}

/* CARD: EXISTING STORY */
.str-card.existing-story {
    background: #000;
    border-radius: var(--str-radius);
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    aspect-ratio: 9 / 16;
    min-height: 380px;
    transition: all 0.3s ease;
    box-shadow: var(--str-shadow-sm);
    border: 1px solid rgba(0,0,0,0.05);
}

.str-card.existing-story:hover {
    transform: translateY(-8px);
    box-shadow: var(--str-shadow-md);
}

.media-preview {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.media-preview img, 
.media-preview video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* CARD ELEMENTS */
.media-type-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    z-index: 2;
}

.btn-delete {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.9);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #e53e3e;
    z-index: 5;
    transition: all 0.2s;
    text-decoration: none;
    opacity: 0;
    transform: scale(0.8);
}

.str-card.existing-story:hover .btn-delete {
    opacity: 1;
    transform: scale(1);
}

.btn-delete:hover {
    background: #e53e3e;
    color: white;
    transform: scale(1.1);
}

/* OVERLAY STATS - BASE */
.overlay-stats {
    position: absolute;
    left: 0;
    width: 100%;
    color: white;
    z-index: 2;
    pointer-events: none; /* KEY FIX: Pass clicks to video */
}

/* OVERLAY STATS - BOTTOM (For Images) */
.overlay-stats.overlay-bottom {
    bottom: 0;
    padding: 3rem 1rem 1rem;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
}

/* OVERLAY STATS - TOP (For Videos) */
.overlay-stats.overlay-top {
    top: 0;
    bottom: auto;
    padding: 4rem 1rem 1rem; /* Extra top padding to clear delete button */
    background: linear-gradient(to bottom, rgba(0,0,0,0.8), transparent);
}

.stat-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.story-expiry {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.8);
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Expired State */
.str-card.existing-story.expired .media-preview img,
.str-card.existing-story.expired .media-preview video {
    filter: grayscale(100%);
    opacity: 0.7;
}

a.storyprofilename {
    color:#FE4365;
}

/* RESPONSIVE */
@media screen and (max-width: 768px) {
    #str-user.str-body, #str-item.str-body, #str-edit-story.str-body { padding: 1rem; }
    
    .str-grid-wrapper {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .str-card.existing-story {
        min-height: 260px;
    }
    .str-card.create-new {
        max-height: 160px;
        width: 100%;
        min-height: unset;
    }
    .btn-delete { opacity: 1; transform: scale(1); }
    
    .str-stat-card .value { font-size: 1.4rem; }
}

@media screen and (max-width: 480px) {
    .str-grid-wrapper {
        grid-template-columns: 1fr;
    }
}

/* =========================================================== */
/* PART 3: CREATE STORY FORM STYLES                            */
/* =========================================================== */

.str-form-container {
    max-width: 600px;
    margin: 0 auto;
    background: #fff;
    border-radius: var(--str-radius);
    padding: 2rem 3rem 3rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    border: 1px solid #edf2f7;
}

.str-upload-zone {
    margin-bottom: 2rem;
}

.frm-upload-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
    border: 2px dashed #cbd5e0;
    border-radius: var(--str-radius);
    background: #f8f9fc;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    color: var(--str-text-light);
    text-align: center;
    width: 100%;
}

.frm-upload-button:hover {
    border-color: var(--str-primary);
    background: #fff5f7;
    color: var(--str-primary);
    text-decoration: none;
}

.frm-upload-button svg {
    width: 48px;
    height: 48px;
    fill: #cbd5e0;
    margin-bottom: 1rem;
    transition: fill 0.2s;
}

.frm-upload-button:hover svg {
    fill: var(--str-primary);
}

.frm-upload-button strong {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--str-text-dark);
}

.frm-upload-button span {
    font-size: 0.85rem;
    color: var(--str-text-light);
    line-height: 1.4;
}

.error-upload-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
    border: 2px dashed #cbd5e0;
    border-radius: var(--str-radius);
    background: #f8f9fc;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    color: var(--str-text-light);
    text-align: center;
    width: 100%;
}
.error-upload-button:hover {
    border-color: var(--str-primary);
    background: #fff5f7;
    color: var(--str-primary);
    text-decoration: none;
}
.error-upload-button svg {
    width: 48px;
    height: 48px;
    fill: #cbd5e0;
    margin-bottom: 1rem;
    transition: fill 0.2s;
}
.error-upload-button:hover svg {
    fill: var(--str-primary);
}
.error-upload-button strong {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--str-text-dark);
}
.error-upload-button span {
    font-size: 0.85rem;
    color: var(--str-text-light);
    line-height: 1.4;
}

/* Form Inputs */
.str-input-group {
    margin-bottom: 2rem;
}

.str-input-group label {
    display: block;
    font-weight: 700;
    color: var(--str-text-dark);
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.str-input-group input[type="text"] {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    transition: border-color 0.2s;
    outline: none;
    background: #fff;
    color: var(--str-text-dark);
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.str-input-group input[type="text"]:focus {
    border-color: var(--str-primary);
    box-shadow: 0 0 0 3px rgba(254, 67, 101, 0.1);
}

.str-input-helper {
    font-size: 0.8rem;
    color: var(--str-text-light);
    margin-top: 0.75rem;
    line-height: 1.4;
}

/* Submit Button */
.str-btn-submit {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--str-primary), var(--str-primary-hover));
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.str-btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(254, 67, 101, 0.3);
}

/* Uploaded File Preview Item */
.str-res-one {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    border: 1px solid #edf2f7;
    box-shadow: 0 2px 4px rgba(0,0,0,0.03);
}

.str-res-file-name {
    font-weight: 600;
    color: var(--str-text-dark);
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 60%;
}

.str-upload-delete {
    color: #e53e3e;
    font-size: 0.85rem;
    text-decoration: none;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 6px;
    background: rgba(229, 62, 62, 0.08);
    transition: all 0.2s;
}

.str-upload-delete:hover {
    background: #e53e3e;
    color: white;
}

/* Hide extra things */
.str-res-img-vid { display: none; }
.str-errors { margin-bottom: 20px; }
.str-error { 
    background: #fff5f5; 
    border-left: 4px solid #e53e3e; 
    padding: 1rem; 
    color: #e53e3e; 
    border-radius: 4px;
}

@media screen and (max-width: 768px) {
    .str-form-container { padding: 1.5rem; }
    .frm-upload-button { padding: 2rem 1rem; }
}

/* =========================================================== */
/* PART 4: STORY WIDGET (BUBBLES & CIRCLES)                    */
/* =========================================================== */

/* Post story button (Legacy) */
.post-story {
    font-size: 14px;
    color: #FFF !important;
    border-radius: 10px;
    text-align: center;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.3);
    text-transform: uppercase;
    text-decoration: none;
    border: solid 1px #f36;
    background: linear-gradient(to right, #E61E4D 0%, #E31C5F 50%, #D70466 100%);
    font-family: "CircularXXWeb-Medium", sans-serif;
    display: block;
    width: 50%;
    margin: auto;
    padding: 12px 0px;
}
.post-story:hover { background: #F42156;}
.storycount {text-align: center; padding-bottom: 10px;}
.storybox { display: block; margin: auto; width: 70%; }

/* Widget Container */
#str-widget {display:flex;flex-direction: column;margin:20px 0;width:100%;position:relative;}
body.item #str-widget { margin-bottom: -20px;}
.str-title, body.custom .str-title { color: #FE4365; font-size: 1.6em; font-family: "CircularXXWeb-Medium", sans-serif; line-height:20px;margin:0 0 15px 0;}

/* Circles Container */
#str-widget .str-circles {display:flex;flex-direction: row;margin:0;width:100%;flex-wrap: nowrap;overflow-x:auto;padding:0 2px;align-items: center; scrollbar-width: none; position: relative; scroll-behavior: smooth;}

/* Individual Circle */
#str-widget .str-circle {margin:0 12px 6px 0;width:auto;border-radius:200px;padding:2px;border:2px solid #dbdbdb;transition:0.2s;position:relative;}
#str-widget .str-circle:hover {border-color:var(--str-primary, #ff2636);}
#str-widget .str-circle img {min-width:64px;width:64px;height:64px;object-fit:cover;border-radius:200px;}

/* Circle Sizes */
#str-widget .str-circle.str-xsmall img {min-width:36px;width:36px;height:36px;}
#str-widget .str-circle.str-small img {min-width:48px;width:48px;height:48px;}
#str-widget .str-circle.str-large img {min-width:96px;width:96px;height:96px;}
#str-widget .str-circle.str-xlarge img {min-width:120px;width:120px;height:120px;}
#str-widget .str-circle.str-xsmall, #str-widget .str-circle.str-small {margin:0 8px 8px 0;}
#str-widget .str-circle.str-large, #str-widget .str-circle.str-xlarge {margin:0 16px 16px 0;}

/* New Story Ring Animation */
#str-widget .str-circle.str-new:after {
    animation: str-spin 3s linear infinite;
    transition:0.2s;
    content:'';
    position: absolute; 
    width: calc(100% + 4px); 
    height: calc(100% + 4px); 
    border-radius: 50%;
    top: -2px; 
    left: -2px; 
    background: conic-gradient(from 0deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888, #f09433);
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), white calc(100% - 2px));
    mask: radial-gradient(farthest-side, transparent calc(100% - 3px), white calc(100% - 2px));
    z-index: 0;
}
#str-widget .str-circle.str-new {border-color:transparent;}
#str-widget .str-circle.str-new:hover {border-color: var(--str-primary, #ff2636) !important;}
#str-widget .str-circle.str-new:hover:after {opacity:0;}
@keyframes str-spin {from {transform: rotate(0deg);} to {transform: rotate(360deg);}}

/* Plus Circle */
#str-widget .str-circle.str-circle-plus {
    border-radius: 50%;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 28px !important;
    height: 28px !important;
    border: none;
    background: linear-gradient(to right, #E61E4D 0%, #E31C5F 50%, #D70466 100%);
    position: absolute;
    bottom: 0px;
    right: 8px;
}
#str-widget .str-circle.str-circle-plus i {
    font-size: 20px;
    color: #fff;
    line-height: 1;
    position: static;
    margin: 0;
    padding: 0;
}
#str-widget .str-circle.str-circle-plus:hover {
    background: #FF3366;
}
#str-widget .str-circle.str-circle-plus.str-medium {width:44px;height:44px;}
#str-widget .str-circle.str-circle-plus.str-large, #str-widget .str-circle.str-circle-plus.str-xlarge {width:64px;height:64px;}

/* Story circle wrapper with name */
.str-circle-wrapper {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    margin: 0 8px 12px 0;
    max-width: 80px;
}

/* Circle stays the same */
.str-circle-wrapper .str-circle {
    margin: 0 0 6px 0;
}

.str-circle:hover ~ .str-circle-name {
    color: #FE4365;
}

/* Listing name under thumbnail */
.str-circle-name {
    font-size: 12px;
    color: #191919;
    text-align: center;
    line-height: 14px;
    max-width: 74px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
    font-family: "CircularXXWeb-Medium", sans-serif;
    margin-right: 10px;
}

/* Arrow containers with gradient backgrounds */
.str-arrow-container {
    position: absolute;
    top: 29px;
    width: 80px;
    height: 80px;
    display: none;
    align-items: center;
    z-index: 10;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    right: -11px !important;
}

.str-arrow-container.visible {
    display: flex;
    opacity: 1;
}

.str-arrow-container-left {
    left: 0;
    background: linear-gradient(to right, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0));
    justify-content: flex-start;
    padding-left: 14px;
}

.str-arrow-container-right {
    right: 0;
    background: linear-gradient(to left, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0));
    justify-content: flex-end;
    padding-right: 10px;
}

/* Navigation arrow buttons */
.str-nav-arrow {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    border-radius: 50%;
    cursor: pointer;
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.str-nav-arrow:hover {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transform: scale(1.05);
}

/* Arrow icons */
.str-nav-arrow::before {
    content: '';
    width: 10px;
    height: 10px;
    border-right: 5px solid #262626;
    border-bottom: 5px solid #262626;
    display: block;
}

.str-nav-arrow:hover::before {
    border-right: 5px solid #FE4365;
    border-bottom: 5px solid #FE4365;
}

.str-nav-arrow.str-arrow-left::before {
    transform: rotate(135deg);
    margin-right: -3px;
}

.str-nav-arrow.str-arrow-right::before {
    transform: rotate(-45deg);
    margin-left: -3px;
}

/* Widget Responsive */
@media screen and (max-width: 480px) {
    .str-title {
        padding: 0px 3% 0px;
        font-size: 1.4em;
    }
    #str-widget .str-circles {
        margin: 0 2%;
        width: 96%;
    }
    .str-arrow-container.visible {
        display:none;
    }
    .post-story { width: 100%; display: block; padding: 12px 0px;}
    .storybox { width: 90%; }
		body.item #str-widget .str-circle.str-circle-plus {
	height: 30px !important;
    width: 30px !important;
	position: absolute;    
	bottom: -3px;
	right: 3px;
	background: linear-gradient(to right, rgb(230, 30, 77) 0%, rgb(227, 28, 95) 50%, rgb(215, 4, 102) 100%);
	border: none;
	}
	body.item #str-widget .str-circle.str-circle-plus i {
		color:#FFFFFF;
	}
}

/* Mobile - hide navigation arrows in widget */
@media screen and (max-width: 768px) {
    .str-nav-arrow {
        display: none !important;
    }
    #str-widget .str-circles::before,
    #str-widget .str-circles::after {
        display: none;
    }
	.str-item-header h2, .str-dashboard-header .str-page-title {
		    font-size: 1.2rem;
	}
}
