/* =========================================================
   AlphaRomeo15 plugin / legacy compatibility layer
   Targets common old MyBB markup without requiring plugin rewrites.
   ========================================================= */

/* Never allow plugin output to break the viewport */
#content table,
#content div,
#content form,
#content fieldset{
  max-width:100%;
}
#content pre,#content code{
  max-width:100%;
  overflow:auto;
  white-space:pre-wrap;
  overflow-wrap:anywhere;
}
#content img[width],#content iframe[width]{max-width:100%!important}

/* AlphaRomeo15 Action Report / recent activity style */
[id*="actionreport" i],
[class*="actionreport" i],
[id*="action_report" i],
[class*="action_report" i],
[id*="recent" i][class*="thread" i],
[class*="recent" i][class*="thread" i]{
  max-width:100%;
}
[id*="actionreport" i] table,
[class*="actionreport" i] table,
[id*="action_report" i] table,
[class*="action_report" i] table{
  width:100%!important;
  table-layout:auto;
}
[id*="actionreport" i] td,
[class*="actionreport" i] td,
[id*="action_report" i] td,
[class*="action_report" i] td{
  overflow-wrap:anywhere;
}

/* Likes / Thanks / reputation blocks */
[class*="like" i],
[id*="like" i],
[class*="thank" i],
[id*="thank" i]{
  max-width:100%;
}
[class*="like" i] img,
[id*="like" i] img{
  max-width:28px;
  height:auto;
}
[class*="like" i] table,
[id*="like" i] table,
[class*="thank" i] table,
[id*="thank" i] table{
  width:100%!important;
}

/* Profile plugin tables */
.profile_fields table,
[class*="profile" i] table{
  max-width:100%;
}

/* Portal plugins/cards */
#portal table,
.portal table,
[class*="portal" i] table{
  width:100%!important;
}

/* Select2 used by MyBB / plugins */
.select2-container{max-width:100%!important}
.select2-dropdown{background:#15191b;color:#eee;border-color:#495154}
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple{
  background:#0f1213;
  border-color:#4a5255;
  color:#eee;
}

/* Old fixed-width inline style recovery */
@media (max-width:760px){
  #content table[width],
  #content td[width],
  #content div[style*="width:"],
  #content form[style*="width:"]{
    max-width:100%!important;
  }

  /* Plugin tables can scroll rather than crush */
  [id*="actionreport" i],
  [class*="actionreport" i],
  [id*="action_report" i],
  [class*="action_report" i],
  [id*="like" i],
  [class*="like" i],
  [id*="thank" i],
  [class*="thank" i]{
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
  }

  /* Clean up giant legacy spacer cells */
  td[width="20%"],td[width="25%"],td[width="30%"],td[width="40%"]{
    min-width:0;
  }
}

/* Optional class available for any specific stubborn plugin template:
   wrap the plugin's table with <div class="ar15-plugin-wrap"> ... </div> */
.ar15-plugin-wrap{
  width:100%;
  max-width:100%;
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
  border-radius:6px;
}
.ar15-plugin-wrap table{
  width:100%!important;
  min-width:0;
}
@media(max-width:620px){
  .ar15-plugin-wrap table.ar15-stackable,
  .ar15-plugin-wrap table.ar15-stackable tbody,
  .ar15-plugin-wrap table.ar15-stackable tr,
  .ar15-plugin-wrap table.ar15-stackable td{
    display:block;
    width:100%!important;
  }
  .ar15-plugin-wrap table.ar15-stackable td{
    border-bottom:1px solid #30373a;
  }
}


/* =========================================================
   AlphaRomeo15 — installed plugin compatibility (Oct 2026)
   ========================================================= */

/* ---------- Simple Audio Video Embedder ---------- */
.post_body iframe,
.post_body video,
.post_body audio,
[class*="video" i] iframe,
[class*="embed" i] iframe{
  max-width:100%!important;
}
.post_body iframe[src*="youtube"],
.post_body iframe[src*="youtu.be"],
.post_body iframe[src*="vimeo"]{
  width:min(100%,900px)!important;
  aspect-ratio:16/9;
  height:auto!important;
  border:0;
  border-radius:6px;
  background:#000;
}

/* ---------- Image Auto Resizer / Image Upload ---------- */
.post_body img,
.scaleimages img,
[class*="image_resizer" i] img,
[class*="uploaded_image" i] img{
  max-width:100%!important;
  height:auto!important;
}
[class*="image_resizer" i],
[class*="image-upload" i],
[id*="image-upload" i],
[id*="imageupload" i]{
  max-width:100%!important;
}
[class*="image-upload" i] input[type="file"],
[id*="image-upload" i] input[type="file"]{
  max-width:100%;
  padding:7px;
  border:1px dashed var(--ar-line);
  border-radius:4px;
  background:var(--ar-panel2);
  color:var(--ar-text);
}

/* ---------- DVZ Stream ---------- */
#stream,
.dvz_stream,
[id*="dvz_stream" i],
[class*="dvz_stream" i]{
  width:100%!important;
  max-width:100%!important;
}
#stream table,
.dvz_stream table,
[id*="dvz_stream" i] table,
[class*="dvz_stream" i] table{
  width:100%!important;
  table-layout:auto;
}
#stream td,
.dvz_stream td,
[id*="dvz_stream" i] td,
[class*="dvz_stream" i] td{
  overflow-wrap:anywhere;
}
html[data-ar-theme="light"] #stream,
html[data-ar-theme="light"] .dvz_stream{
  color:#292d2e;
}

/* ---------- ezGallery Lite ---------- */
[class*="gallery" i] img,
[id*="gallery" i] img{
  max-width:100%;
  height:auto;
}
[class*="gallery" i] table,
[id*="gallery" i] table{
  max-width:100%;
}
[class*="gallery" i] .trow1,
[class*="gallery" i] .trow2{
  vertical-align:top;
}
@media(max-width:620px){
  [class*="gallery" i] td[width],
  [id*="gallery" i] td[width]{
    width:auto!important;
  }
}

/* ---------- Favorite Threads ---------- */
a[href*="favorite"],
a[href*="favorites"]{
  max-width:100%;
}
.usercp_nav_favorites,
.usercp_nav_favorite_threads{
  background-image:none!important;
}
.usercp_nav_favorites:before,
.usercp_nav_favorite_threads:before{
  content:"★";
  display:inline-block;
  width:18px;
  color:var(--ar-tan);
}

/* ---------- Hovercards ---------- */
.hovercard,
.hovercard-container,
[class*="hovercard" i]{
  max-width:min(92vw,380px)!important;
  color:var(--ar-text)!important;
  border:1px solid var(--ar-line)!important;
  border-radius:6px!important;
  box-shadow:0 14px 32px rgba(0,0,0,.36)!important;
}
html[data-ar-theme="light"] .hovercard,
html[data-ar-theme="light"] .hovercard-container,
html[data-ar-theme="light"] [class*="hovercard" i]{
  color:#272b2c!important;
  border-color:#aaa9a1!important;
  box-shadow:0 14px 28px rgba(0,0,0,.18)!important;
}

/* ---------- My Advertisements ---------- */
[class*="advert" i],
[id*="advert" i],
[class*="adslot" i],
[id*="adslot" i]{
  max-width:100%!important;
  overflow:hidden;
}
[class*="advert" i] img,
[id*="advert" i] img,
[class*="adslot" i] img,
[id*="adslot" i] img{
  max-width:100%!important;
  height:auto!important;
}

/* ---------- MyAlerts + Moderation Alerts Pack ---------- */
.alerts,
.alert,
[class*="myalerts" i]{
  max-width:100%;
}
.myalerts_popup a{overflow-wrap:anywhere}
.alerts--new{
  font-weight:800!important;
}
html[data-ar-theme="light"] .alerts--new{
  color:#8a1f29!important;
}

/* ---------- MySubscriptions ---------- */
[class*="subscription" i] table,
[id*="subscription" i] table,
form[action*="subscription" i] table{
  width:100%!important;
  max-width:100%!important;
}
[class*="subscription" i] input,
[id*="subscription" i] input,
form[action*="subscription" i] input{
  max-width:100%;
}

/* ---------- OUGC Auction System ---------- */
[class*="ougc" i][class*="auction" i],
[id*="ougc" i][id*="auction" i],
[class*="auction" i],
[id*="auction" i]{
  max-width:100%;
}
[class*="auction" i] table,
[id*="auction" i] table{
  width:100%!important;
  max-width:100%!important;
}
[class*="auction" i] img,
[id*="auction" i] img{
  max-width:100%;
  height:auto;
}
[class*="auction" i] input,
[id*="auction" i] input,
[class*="auction" i] select,
[id*="auction" i] select{
  max-width:100%;
}

/* ---------- Thank You / Like System 3.4.x ---------- */
/* Keep the AJAX button on the same row as Reply/Quote/etc. */
div[id^="tyl_btn_"]{
  display:inline-block!important;
  vertical-align:middle;
  margin:2px 4px 2px 0!important;
}
div[id^="tyl_btn_"] .postbit_buttons,
div[id^="tyl_btn_"].postbit_buttons{
  display:inline-block!important;
}
a.add_tyl_button,
a.del_tyl_button{
  display:inline-flex!important;
  align-items:center;
  gap:6px;
  min-height:27px;
  margin:0!important;
  padding:5px 9px!important;
  border:1px solid #526052!important;
  border-radius:3px!important;
  background:#222824!important;
  color:#e6e7df!important;
  font-size:11px!important;
  font-weight:800!important;
  line-height:1.2!important;
  text-transform:uppercase;
  box-shadow:none!important;
}
a.add_tyl_button:hover{
  border-color:#879675!important;
  background:#30382f!important;
  color:#fff!important;
}
a.del_tyl_button{
  border-color:#695053!important;
  background:#292123!important;
}
a.del_tyl_button:hover{
  border-color:#9c5960!important;
  background:#3a2428!important;
}
a.add_tyl_button span,
a.del_tyl_button span{
  min-height:16px;
  display:inline-flex!important;
  align-items:center;
  background-position:left center!important;
  background-repeat:no-repeat!important;
}
.tyllist,
.tyllist_classic{
  clear:both;
  margin:8px 10px 10px!important;
  padding:9px 11px!important;
  border:1px solid #3f4844!important;
  border-left:3px solid var(--ar-od)!important;
  border-radius:4px;
  background:#121715!important;
  color:#bdc4bc!important;
  font-size:11px;
  overflow-wrap:anywhere;
}
.tyllist a,
.tyllist_classic a{color:#cbd6bd!important}
.tyllist img,
.tyllist_classic img{vertical-align:middle;max-width:18px;height:auto}
html[data-ar-theme="light"] a.add_tyl_button{
  color:#fff!important;
  border-color:#59634e!important;
  background:#59634e!important;
}
html[data-ar-theme="light"] a.del_tyl_button{
  color:#fff!important;
  border-color:#77454a!important;
  background:#77454a!important;
}
html[data-ar-theme="light"] .tyllist,
html[data-ar-theme="light"] .tyllist_classic{
  color:#444a47!important;
  border-color:#c5c2b8!important;
  border-left-color:#59634e!important;
  background:#eceae3!important;
}
html[data-ar-theme="light"] .tyllist a,
html[data-ar-theme="light"] .tyllist_classic a{color:#405942!important}

/* ---------- View Unread Posts ---------- */
a[href*="unread"],
a[href*="getnew"],
a[href*="getdaily"]{
  overflow-wrap:anywhere;
}

/* ---------- MyBB FancyBox (currently inactive, pre-styled for activation) ---------- */
.fancybox__container,
.fancybox-container{
  z-index:99999!important;
}
.fancybox__caption,
.fancybox-caption{font-family:var(--ar-font)}

/* ---------- Page Manager ---------- */
[class*="page_manager" i],
[id*="page_manager" i],
[class*="pagemanager" i],
[id*="pagemanager" i]{
  max-width:100%;
}

/* =========================================================
   ALPHAROMEO15 — MYALERTS DROPDOWN UNDER ALERTS BUTTON
   ========================================================= */

/* The Alerts item becomes our positioning anchor */
.ar15-alert-slot,
.alerts {
    position: relative !important;
}


/* MyAlerts popup */
#myalerts_alerts_modal {
    position: fixed !important;

    width: 420px !important;
    max-width: calc(100vw - 30px) !important;
    max-height: 70vh !important;

    margin: 0 !important;

    overflow-x: hidden !important;
    overflow-y: auto !important;

    z-index: 999999 !important;

    background: #15191b !important;
    border: 1px solid #454e51 !important;
    border-top: 3px solid #8e1f27 !important;
    border-radius: 0 0 7px 7px !important;

    box-shadow:
        0 18px 45px rgba(0,0,0,.65),
        0 0 0 1px rgba(255,255,255,.03) !important;
}


/* Remove normal centered-modal behavior */
#myalerts_alerts_modal.modal {
    padding: 0 !important;
    transform: none !important;
}


/* Alert title */
#myalerts_alerts_modal .thead,
#myalerts_alerts_modal .popupTitle {
    position: sticky !important;
    top: 0 !important;
    z-index: 5 !important;

    background: linear-gradient(
        90deg,
        #8e1f27,
        #55272c 60%,
        #1c2c43
    ) !important;

    color: #fff !important;
}


/* Alert rows */
#myalerts_alerts_modal .trow1,
#myalerts_alerts_modal .trow2 {
    color: #e7e4db !important;
}

#myalerts_alerts_modal .trow1 {
    background: #181c1e !important;
}

#myalerts_alerts_modal .trow2 {
    background: #202528 !important;
}


/* Unread alert */
#myalerts_alerts_modal .alert--unread {
    background: rgba(142,31,39,.16) !important;
}


/* Footer controls */
#myalerts_alerts_modal .popupFooter,
#myalerts_alerts_modal .tcat {
    position: sticky !important;
    bottom: 0 !important;
    z-index: 5 !important;

    background: #101314 !important;
    border-top: 1px solid #394044 !important;
}


/* LIGHT THEME */
html[data-ar-theme="light"] #myalerts_alerts_modal {
    background: #faf9f5 !important;
    border-color: #aaa9a1 !important;
    border-top-color: #85212a !important;

    box-shadow:
        0 18px 45px rgba(0,0,0,.28),
        0 0 0 1px rgba(255,255,255,.4) !important;
}

html[data-ar-theme="light"] #myalerts_alerts_modal .trow1 {
    color: #292d2e !important;
    background: #faf9f5 !important;
}

html[data-ar-theme="light"] #myalerts_alerts_modal .trow2 {
    color: #292d2e !important;
    background: #efede7 !important;
}

html[data-ar-theme="light"] #myalerts_alerts_modal .alert--unread {
    background: #f4e3e4 !important;
}


/* MOBILE */
@media (max-width: 600px) {

    #myalerts_alerts_modal {
        width: calc(100vw - 20px) !important;
        max-width: calc(100vw - 20px) !important;

        left: 10px !important;
        right: auto !important;

        max-height: 75vh !important;

        border-radius: 6px !important;
    }

}

/* ---------- Backend / no direct front-end skin required ----------
   ABP SiteMap
   Activate Users from Mod CP
   MyBB Default Avatar Fix
   Google SEO
   Template Conditionals
   RSS Feed Poster
   PluginLibrary
   Those are left alone intentionally: they primarily alter logic, routing,
   ACP functionality, or template processing rather than drawing standalone UI.
*/
