@import url('pages/upload.css');

@import url('pages/account.css');

@import url('pages/artwork.css');

@import url('pages/home.css');

@import url('pages/login.css');

/* =================================================================== */
/* Global CSS Organization                                              */
/* Sections:                                                            */
/* 1) Basics (reset, variables, body, typography)                       */
/* 2) Layout (header, main containers)                                  */
/* 3) Components (tabs, cards, etc.)                                    */
/* 4) Forms & Buttons                                                   */
/* 5) Utilities & Animations                                            */
/* 6) Responsive                                                        */
/* =================================================================== */

/* 1) Basics: Body & Typography */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    margin: 0;
    background-color: #f4f4f4;
    color: #333;
}

h1, h2, h3 {
    line-height: 1.2;
}

/* 2) Layout: Header & Navigation */
header {
    background: #fff;
    padding: 1rem 2rem;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    margin: 0;
    font-size: 1.5rem;
}

/* Group back button and title inline on pages that use a left header group */
.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Account header nav alignment and link style */
header nav[aria-label="Account"] {
    margin-left: auto; /* push to the right within header flex */
}

.header-text-link {
    background: transparent;
    color: #111;
    padding: 0;
    border: none;
    border-radius: 0;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
}

.header-text-link:hover {
    text-decoration: underline;
}

.header-text-link:focus-visible {
    outline: 2px solid #111;
    outline-offset: 2px;
}

/* Back link: geometric arrow with pseudo-element (no text glyph) */
.header-back-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: #000000;
    border: none;
    padding: 8px;
    width: 32px;
    height: 32px;
    /* hide the literal "<" text while keeping aria-label for a11y */
    font-size: 0;
    line-height: 1;
    letter-spacing: -0.01em;
    text-decoration: none;
    cursor: pointer;
    position: relative;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Geometric arrow construction */
.header-back-link::before {
    content: '';
    width: 16px;
    height: 16px;
    background: transparent;
    border-left: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.header-back-link:hover,
.header-back-link:focus {
    text-decoration: none; /* override header-text-link hover underline */
}

/* Interaction states for back link */
.header-back-link:hover {
    color: #333333;
    transform: translateX(-2px); /* Directional hint */
}

.header-back-link:hover::before {
    border-color: #333333;
    transform: rotate(45deg) translateX(-1px);
}

.header-back-link:active {
    transform: translateX(0);
    transition-duration: 0.1s;
}

.header-back-link:active::before {
    transform: rotate(45deg) translateX(0);
}

/* 2) Layout: Main Content */
main {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}


/* 4) Forms & Inputs
   Note: Upload page-specific rules were moved to pages/upload.css historically.
   The remaining blocks here are generalized form components reused across pages. */

.description-section {
    padding: 0;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    background: #ffffff;
}

.description-section textarea {
    width: 100%;
    border: none;
    outline: none;
    resize: vertical;
    font-family: inherit;
    font-size: 16px;
    line-height: 1.5;
    color: #333;
    background: transparent;
    padding: 15px;
    min-height: 120px;
    border-radius: 8px;
}

.description-section textarea::placeholder {
    color: #999;
}

.picker-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.picker-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    cursor: pointer;
    position: relative;
    background: #ffffff;
    transition: border-color 0.2s;
}

.picker-item:hover {
    border-color: #333;
}

.picker-label {
    flex: 1;
    font-size: 16px;
    color: #333;
}

.picker-arrow {
    font-size: 18px;
    color: #999;
    margin-left: 10px;
}

.picker-item select,
.picker-item input[type="text"] {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    border: none;
    background: transparent;
}

.picker-item input[type="text"] {
    opacity: 1;
    background: transparent;
    border: none;
    outline: none;
    padding-left: 60px;
    font-size: 16px;
    color: #333;
}

.picker-item input[type="text"]::placeholder {
    color: #999;
}

.title-section {
    padding: 0;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    background: #ffffff;
}

.title-section input {
    width: 100%;
    border: none;
    outline: none;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    background: transparent;
    padding: 15px;
    border-radius: 8px;
}

.title-section input::placeholder {
    color: #999;
    font-weight: normal;
}

.content-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
  min-height: 0;
}



.btn-small {
    padding: 6px 12px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-small:hover {
    background: #0056b3;
}

/* Delete artwork button styling */
.delete-artwork-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease, background-color 0.2s ease;
    z-index: 10;
    color: #dc3545;
}

.delete-artwork-btn:hover {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

.artwork-card:hover .delete-artwork-btn {
    opacity: 1;
}

/* Location Picker Styles */
.location-selectors {
    display: flex;
    gap: 10px;
}

.location-selectors select {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    font-size: 14px;
    color: #333;
}

.location-selectors select:focus {
    outline: none;
    border-color: #007bff;
}

/* 6) Responsive: Forms & Pickers (mobile) */
@media (max-width: 768px) {
    .description-section textarea {
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .location-selectors {
        flex-direction: column;
    }
    
}



/* 3) Components: Tabs */
.tabs {
    border-bottom: 1px solid #ccc;
    margin-bottom: 20px;
}

.tab-link {
    background: none;
    border: none;
    padding: 15px 20px;
    cursor: pointer;
    font-size: 1em;
    color: #666;
    border-bottom: 3px solid transparent;
}

.tab-link.active {
    color: #000;
    border-bottom-color: #333;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.section-divider {
    border-top: 1px solid #eee;
    margin: 30px 0;
}

/* 4) Buttons & Forms */
.btn {
    display: inline-block;
    background: #333;
    color: #fff;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 5px;
    text-decoration: none;
    cursor: pointer;
    font-size: 1rem;
}
/* Disabled button state */
.btn:disabled,
.btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(25%);
}

#auth-container form {
    display: flex;
    gap: 0.5rem;
}

/* Pill dark button for header login */
.pill-dark-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #111;
    color: #fff;
    border: 1px solid #222;
    border-radius: 9999px;
    padding: 0.5rem 1rem;
    font-weight: 600;
    cursor: pointer;
}

.pill-dark-btn:hover {
    background: #000;
}


/* 3) Components: Page content (Tart / About) */
.page-content { max-width: 900px; margin: 0 auto; padding: 1rem 0; }

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-top: 12px;
}

.feature-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.06);
    overflow: hidden;
}

.feature-img {
    height: 160px;
    background: linear-gradient(135deg,#e8ecf1,#dfe5eb);
}

.feature-body { padding: 14px; }
.feature-body h3 { margin: 0 0 6px 0; }
.feature-body p { margin: 0; color: #555; }

.letter {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.06);
    line-height: 1.8;
}

.signature { margin-top: 16px; font-style: italic; color: #444; }

/* 5) Utilities & Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.8s ease-out both;
    animation-delay: var(--stagger, 0ms);
}

/* Pre-reveal hidden state for IntersectionObserver */
.will-reveal {
    opacity: 0;
    transform: translateY(20px);
}

/* Line expand animation for ruler/underline effects (used in Tart tagline) */
@keyframes lineExpand {
    from { width: 0; }
    to   { width: 40px; }
}

/* Tart wordmark baseline style to match header logo weight/size */
.tart-wordmark {
    font-size: 1.5rem;
    font-weight: 400;
    letter-spacing: 0;
    margin: 0;
}

/* CTA link shared style */
.cta-link {
    display: inline-block;
    margin-top: 24px;
    padding: 12px 48px 12px 24px;
    background: #000;
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 0.02em;
    white-space: nowrap;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.cta-link::after {
    content: '→';
    position: absolute;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    transition: transform 0.2s ease;
}

.cta-link:hover {
    padding-right: 64px;
    background: #111;
}

.cta-link:hover::after {
    transform: translateY(-50%) translateX(4px);
}

/* 6) Responsive: Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .fade-in { animation: none !important; }
    .will-reveal { opacity: 1 !important; transform: none !important; }
    .cta-link { transition: none !important; }
    .cta-link::after { transition: none !important; }
}

/* 6) Responsive: Mobile header override (placed late to win cascade): toggle left of tagline */
@media (max-width: 680px) {
  .app header {
    display: grid !important;
    grid-template-columns: auto 1fr;
    grid-template-areas:
      "logo auth"
      "toggle tagline";
    column-gap: 8px;
    row-gap: 6px;
    align-items: center;
  }
  .app header .logo-toggle { display: contents; }
  .app header .logo-toggle h1 { grid-area: logo; margin: 0; }
  .app header #auth-container { grid-area: auth; justify-self: end; margin-left: 0; }
  .app header #sidebar-toggle { grid-area: toggle; position: static; opacity: 1; pointer-events: auto; margin: 0; }
  .app header p { grid-area: tagline; margin: 0; text-align: left; font-size: 0.95rem; }
}
