/* =================================================================== */
/*    PARTIAL: UI ELEMENTS                                             */
/*    Contains: Base interface objects, Forms, Buttons, Alerts,         */
/*    Autocomplete, and Skeleton Loaders.                              */
/* =================================================================== */

/* --- ICON BOX --- */
.icon-box {
    position: relative;
    background: var(--border-gradient-onyx);
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 16px;
    color: var(--orange-yellow-crayola);
    box-shadow: var(--shadow1);
    z-index: 1;
}

.icon-box::before {
    content: '';
    position: absolute;
    inset: 1px;
    background: var(--eerie-black1);
    border-radius: inherit;
    z-index: -1;
}

.icon-box ion-icon {
  --ionicon-stroke-width: 35px;
}

/* --- SHARED CONTENT CARD WRAPPER --- */
.content-card {
    position: relative;
    background: var(--border-gradient-onyx);
    padding: 15px;
    padding-top: 45px;
    border-radius: 14px;
    box-shadow: var(--shadow2);
    cursor: pointer;
    z-index: 1;
}

.content-card::before {
    content: '';
    position: absolute;
    inset: 1px;
    background: var(--bg-gradient-jet);
    border-radius: inherit;
    z-index: -1;
}

/* --- AVATAR & PROFILE BOXES --- */
.avatar-box {
    background: var(--bg-gradient-onyx);
    border-radius: 20px;
    cursor: pointer;
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

/* --- SERVICE ITEM CARDS --- */
.service-item {
    position: relative;
    background: var(--border-gradient-onyx);
    padding: 20px;
    border-radius: 14px;
    box-shadow: var(--shadow2);
    z-index: 1;
}

.service-item::before {
    content: '';
    position: absolute;
    inset: 1px;
    background: var(--bg-gradient-jet);
    border-radius: inherit;
    z-index: -1;
}

.service-icon-box {
  margin-bottom: 10px;
}
.service-icon-box img {
  margin: auto;
}

.service-content-box {
  text-align: center;
  width: 100%;
}
.service-item-title {
  margin-bottom: 7px;
}

.service-item-text {
    color: var(--light-gray);
    font-size: var(--fs6);
    font-weight: var(--fw300);
    line-height: 1.6;
}
.service-item-text p {
  text-align: left;
}

/* --- TYPOGRAPHY & HEADER REFINEMENT --- */
.article-title {
    position: relative;
    padding-bottom: 15px; 
    margin-bottom: 35px; /* Increased margin for better separation from search/content */
    text-transform: capitalize;
    font-weight: var(--fw600);
    color: var(--white2);
    font-size: var(--fs1); /* Restores the correct large H2 size */
}

.article-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px; 
    height: 5px;  
    background: var(--text-gradient-yellow);
    border-radius: 3px;
}

/* --- FORM INPUTS & SELECTS --- */
.form-input {
    color: var(--white2);
    font-size: var(--fs6);
    font-weight: var(--fw400);
    padding: 13px 20px;
    border: 1px solid var(--jet);
    border-radius: 14px;
    outline: none;
}

.form-input::placeholder {
  font-weight: var(--fw500);
}
.form-input:focus {
  border-color: var(--orange-yellow-crayola);
}
.form-input:focus:invalid {
  border-color: var(--bittersweet-shimmer);
}

select.form-input {
  background-color: var(--eerie-black2);
  cursor: pointer;
}

select.form-input option {
  background: var(--eerie-black1);
  color: var(--white1);
  padding: 12px;
  font-size: 16px;
}

textarea.form-input {
    min-height: 100px;
    height: 120px;
    max-height: 200px;
    resize: vertical;
}

textarea.form-input::-webkit-realizer {
  display: none;
}

/* --- THE BUTTON SYSTEM --- */
.form-btn {
    position: relative;
    width: 100%;
    background: var(--border-gradient-onyx);
    color: var(--orange-yellow-crayola);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 13px 20px;
    border-radius: 14px;
    font-size: var(--fs6);
    text-transform: capitalize;
    box-shadow: var(--shadow3);
    z-index: 1;
    transition: var(--transition1);
}

.form-btn::before {
    content: '';
    position: absolute;
    inset: 1px;
    background: var(--bg-gradient-jet);
    border-radius: inherit;
    z-index: -1;
    transition: var(--transition1);
}

.form-btn ion-icon {
  font-size: 16px;
}

.form-btn:disabled {
    opacity: .7;
    cursor: not-allowed;
}

.form-btn:disabled:hover {
  background: var(--border-gradient-onyx);
}
.form-btn:disabled:hover::before {
  background: var(--bg-gradient-jet);
}

/* --- CUSTOM FILE UPLOAD UI --- */
.file-upload-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.file-upload-wrapper .form-input[type="file"] {
  opacity: 0;
  position: absolute;
  z-index: -1;
  width: 0.1px;
  height: 0.1px;
}

.file-upload-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  width: auto;
  flex-shrink: 0; 
  margin: 0;
}

.file-upload-filename {
  margin-left: 15px;
  color: var(--light-gray70);
  font-size: var(--fs7);
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- FORM ALERTS & FEEDBACK --- */
.form-feedback {
  margin-top: 20px;
  padding: 15px;
  border-radius: 14px;
  font-size: var(--fs6);
  text-align: center;
}

.form-feedback.alert-success {
  background-color: hsla(120, 60%, 85%, 1); 
  color: hsl(120, 60%, 15%); 
  border: 1px solid hsl(120, 60%, 75%);
}

.form-feedback.alert-error {
  background-color: hsla(0, 70%, 90%, 1); 
  color: hsl(0, 70%, 20%);
  border: 1px solid hsl(0, 70%, 80%);
}

/* --- ADDRESS AUTOCOMPLETE DROPDOWNS --- */
.autocomplete-items {
    position: absolute;
    border: 1px solid var(--jet);
    z-index: 10000; 
    top: 100%;
    left: 0;
    right: 0;
    background: var(--eerie-black2);
    border-radius: 0 0 14px 14px;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: var(--shadow3);
}

.autocomplete-item {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid var(--jet);
    color: var(--light-gray);
    font-size: 13px;
}

.autocomplete-item:hover {
    background: var(--onyx);
    color: var(--orange-yellow-crayola);
}

/* --- SKELETON LOADING UI (SHIMMER) --- */
@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-box {
    background: linear-gradient(90deg, 
        var(--eerie-black1) 25%, 
        var(--onyx) 50%, 
        var(--eerie-black1) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite linear;
    border-radius: 12px;
    border: 1px solid var(--jet);
}

.skeleton-container {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 30px;
    width: 100%;
}

.skeleton-header {
    height: 40px;
    width: 200px;
    margin-bottom: 20px;
}

.skeleton-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 25px;
}

.skeleton-card {
    height: 300px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 15px;
}

.skeleton-img-circle {
    height: 150px;
    width: 150px;
    border-radius: 50%;
    margin: 0 auto;
}

.skeleton-line {
    height: 12px;
    width: 100%;
}

.skeleton-line.short {
    width: 60%;
}

/* --- BRANDED PLACEHOLDERS & CENTERING --- */
/* Specifically for the "Bring Your Own Item" / No Image states */
.no-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    background: var(--eerie-black1); 
    color: var(--light-gray70);
    text-align: center;
    position: absolute;
    top: 0;
    left: 0;
    padding: 20px;
    z-index: 5;
}

.no-image-placeholder ion-icon {
    font-size: 64px !important; /* Larger icon for BYOI card */
    color: var(--orange-yellow-crayola);
    opacity: 0.8 !important;
    margin-bottom: 15px;
    transition: transform 0.3s ease;
}

.no-image-placeholder span {
    display: block;
    width: 100%;
    font-size: 14px !important; /* Larger, more readable font like TEST */
    font-weight: 700 !important; /* Bolder for "Custom Engraving" text */
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--white2); /* Brighter text for visibility */
    line-height: 1.2;
}

.project-title, .project-category {
  text-align: center;
  margin-left: 0;
  width: 100%;
}

/* Pill Badges for Tags */
.tech-tag {
    background: rgba(243, 111, 33, 0.1);
    color: var(--orange-yellow-crayola) !important;
    border: 1px solid rgba(243, 111, 33, 0.3);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-block;
    margin-right: 8px;
    margin-bottom: 8px;
}

/* --- THEME-AWARE NPROGRESS BAR (Orange Fix) --- */
#nprogress .bar {
  background: var(--orange-yellow-crayola) !important;
  height: 3px !important;
  z-index: 11001 !important;
}

#nprogress .peg {
  box-shadow: 0 0 10px var(--orange-yellow-crayola), 0 0 5px var(--orange-yellow-crayola) !important;
}

#nprogress .spinner-icon {
  border-top-color: var(--orange-yellow-crayola) !important;
  border-left-color: var(--orange-yellow-crayola) !important;
}

/* --- LAYOUT HARMONIZATION (Vertical Alignment Fix) --- */
/* Forces the Sidebar and Main Content to start at the exact same horizontal level */

@media (min-width: 1250px) {
    main {
        margin-top: 60px !important; /* Matches the top spacing of the TEST site */
        align-items: flex-start !important; /* Prevents flex children from stretching unevenly */
    }

    .sidebar {
        margin-top: 0 !important;
        padding-top: 60px !important; /* Creates internal space for the logo */
        top: 60px !important; /* Anchors the sticky sidebar at the same level as the nav */
    }

    /* Target the swup container and the internal article to clear the navbar */
    #swup.main-content {
        margin-top: 0 !important;
    }

    #swup.main-content > article {
        padding-top: 80px !important; /* Extra 20px over the sidebar to clear the absolute navbar height */
    }
}

/* --- MISC UI UTILITIES --- */
.d-none-important {
    display: none !important;
}

/* --- SOCIAL PROOF TOAST --- */
.craft-notification {
    position: fixed;
    bottom: 30px;
    left: 30px;
    background: var(--eerie-black2);
    border: 1px solid var(--jet);
    padding: 15px 20px;
    border-radius: 12px;
    box-shadow: var(--shadow5);
    display: flex;
    align-items: center;
    gap: 15px;
    /* Increased z-index for mobile interaction over the sidebar/navbar */
    z-index: 1000; 
    transform: translateX(-120%);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    max-width: 340px;
    cursor: pointer;
    text-decoration: none;
}

.craft-notification:hover {
    border-color: var(--orange-yellow-crayola);
    transform: translateX(0) scale(1.02);
    background: var(--bg-gradient-jet);
}

.craft-notification.active {
    transform: translateX(0);
}

/* --- SOCIAL PROOF TOAST --- */
.craft-notification {
    position: fixed;
    bottom: 30px;
    left: 30px;
    background: var(--eerie-black2);
    border: 1px solid var(--jet);
    padding: 15px 25px 15px 20px; /* Extra right padding for close button */
    border-radius: 12px;
    box-shadow: var(--shadow5);
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 1000; 
    transform: translateX(-120%);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    max-width: 340px;
    cursor: pointer;
    text-decoration: none;
    overflow: visible; /* Ensure the X can pop out on desktop */
}

.craft-notification:hover {
    border-color: var(--orange-yellow-crayola);
    transform: translateX(0) scale(1.02);
    background: var(--bg-gradient-jet);
}

.craft-notification.active {
    transform: translateX(0);
}

/* SURGICAL ADD: Close Button Style */
.craft-close-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background: var(--bittersweet-shimmer);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    border: 2px solid var(--eerie-black2);
    box-shadow: var(--shadow1);
    z-index: 1010;
    transition: all 0.2s ease;
    padding: 0;
    line-height: 1;
}

.craft-close-btn:hover {
    transform: scale(1.2);
    background: #ff4d4d;
}

/* Mobile Specific Adjustments for the Toast */
@media (max-width: 768px) {
    .craft-notification {
        left: 10px;
        right: 10px;
        bottom: 90px; /* Sits higher to clear mobile nav */
        max-width: calc(100% - 20px);
        padding: 12px 40px 12px 15px; /* More room for the X */
        /* Prevent the whole card from turning blue/red when tapped */
        -webkit-tap-highlight-color: transparent; 
    }
    
    .craft-close-btn {
        top: 0;
        right: 0;
        width: 44px; /* Even larger hit area for mobile thumbs */
        height: 44px;
        border-radius: 0 12px 0 12px; 
        border: none;
        background: rgba(217, 83, 79, 0.15); /* Slightly darker red for visibility */
        color: var(--bittersweet-shimmer);
        box-shadow: none;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 20px;
        outline: none;
        /* Ensure it stands out as the closing element */
        z-index: 1001; 
        -webkit-tap-highlight-color: transparent;
    }

    /* Surgical Fix: Remove the red fill on active tap to clean up the UI */
    .craft-close-btn:active {
        background: rgba(217, 83, 79, 0.4);
        transform: none; /* Keep it stable on tap */
    }
}

.craft-icon-box {
    width: 40px;
    height: 40px;
    background: var(--bg-gradient-jet);
    border: 1px solid var(--orange-yellow-crayola);
    color: var(--orange-yellow-crayola);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}

.craft-text {
    font-size: 12px;
    color: var(--light-gray);
    line-height: 1.4;
}

.craft-text strong {
    color: var(--white2);
    display: block;
}