@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display&family=Inter:wght@300;400;700&display=swap');

:root {
    --paper: #fcfaf2;
    --ink: #1a1a1a;
    --accent: #d97706;
}

body { 
    font-family: 'Inter', sans-serif; 
    background-color: var(--paper);
    color: var(--ink);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Prevent horizontal scroll */
html, body {
    max-width: 100%;
    overflow-x: hidden;
}

* {
    box-sizing: border-box;
}

h1, h2, h3 {
    font-family: 'DM+Serif+Display', serif;
}

/* Mobile-first responsive typography */
h1 {
    font-size: 2.5rem;
    line-height: 1.1;
}

h2 {
    font-size: 2rem;
    line-height: 1.2;
}

h3 {
    font-size: 1.5rem;
    line-height: 1.3;
}

@media (min-width: 768px) {
    h1 {
        font-size: 4rem;
    }
    
    h2 {
        font-size: 3rem;
    }
    
    h3 {
        font-size: 2rem;
    }
}

@media (min-width: 1024px) {
    h1 {
        font-size: 6rem;
    }
    
    h2 {
        font-size: 4rem;
    }
}

/* Mobile Navigation */
.mobile-menu {
    display: none;
}

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 50;
    display: none;
}

.mobile-menu-panel {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 300px;
    height: 100vh;
    background: white;
    z-index: 51;
    transition: right 0.3s ease;
    padding: 2rem;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
}

.mobile-menu-panel.open {
    right: 0;
}

.mobile-menu-overlay.open {
    display: block;
}

@media (max-width: 767px) {
    .desktop-nav {
        display: none;
    }
    
    .mobile-menu {
        display: block;
    }
    
    .mobile-menu-button {
        background: none;
        border: none;
        font-size: 1.5rem;
        cursor: pointer;
        padding: 0.5rem;
    }
}

@media (min-width: 768px) {
    .mobile-menu-overlay,
    .mobile-menu-panel {
        display: none !important;
    }
}

/* Animated Logo Styles */
.animated-logo {
    background: linear-gradient(45deg, var(--ink), var(--accent), #e11d48, var(--ink));
    background-size: 300% 300%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: var(--ink); /* Fallback for unsupported browsers */
    animation: gradientShift 4s ease-in-out infinite;
    cursor: pointer;
    transition: transform 0.3s ease;
}

/* Mobile logo sizing */
@media (max-width: 767px) {
    .animated-logo {
        font-size: 1.5rem;
        line-height: 1.2;
    }
}

/* Fallback for browsers that don't support background-clip: text */
@supports not (-webkit-background-clip: text) {
    .animated-logo {
        color: var(--accent);
        animation: colorPulse 2s ease-in-out infinite alternate;
    }
}

.animated-logo:hover {
    transform: scale(1.05);
    animation-duration: 1s;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes colorPulse {
    0% {
        color: var(--ink);
    }
    100% {
        color: var(--accent);
    }
}

/* Tab Styles */
.tab-btn {
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.tab-btn.active {
    border-bottom-color: #d97706;
    color: #d97706;
}

.tab-content {
    display: block;
}

.tab-content.hidden {
    display: none;
}

/* Mobile tab optimization */
@media (max-width: 767px) {
    .tab-btn {
        font-size: 0.75rem;
        padding: 0.75rem 1rem;
    }
}

/* Enhanced button styles */
.give-support-btn {
    background: var(--accent);
    color: white !important;
    padding: 12px 24px;
    border: 2px solid var(--accent);
    font-weight: bold;
    text-decoration: none;
    display: inline-block;
    position: relative;
    transition: all 0.2s ease;
    box-shadow: 4px 4px 0px rgba(217, 119, 6, 0.3);
    transform: translateY(0);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    white-space: nowrap;
}

/* Mobile button optimization - HIDE on mobile */
@media (max-width: 767px) {
    .give-support-btn {
        display: none !important;
    }
}

.give-support-btn:hover {
    background: #b45309;
    border-color: #b45309;
    color: white !important;
    box-shadow: 6px 6px 0px rgba(217, 119, 6, 0.4);
    transform: translateY(-2px);
}

.give-support-btn:active {
    transform: translateY(2px);
    box-shadow: 2px 2px 0px rgba(217, 119, 6, 0.3);
    color: white !important;
}

/* QR Code Modal Styles */
#qrModal {
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease-out;
}

#qrModal > div {
    animation: slideIn 0.3s ease-out;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Mobile QR modal optimization */
@media (max-width: 767px) {
    #qrModal > div {
        margin: 1rem;
        max-width: calc(100vw - 2rem);
        padding: 1.5rem;
    }
    
    #qrModal img {
        width: 250px !important;
        height: 250px !important;
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { 
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to { 
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* The "Hand-Made" feel */
.scrapbook-photo {
    background: white;
    padding: 12px;
    padding-bottom: 40px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transform: rotate(-2deg);
    transition: transform 0.3s ease;
}

.scrapbook-photo:hover {
    transform: rotate(0deg) scale(1.02);
}

/* Mobile scrapbook optimization */
@media (max-width: 767px) {
    .scrapbook-photo {
        padding: 8px;
        padding-bottom: 24px;
        transform: rotate(-1deg);
    }
    
    .scrapbook-photo:hover {
        transform: rotate(0deg) scale(1.01);
    }
}

.marker-underline {
    background-image: linear-gradient(120deg, #fde68a 0%, #fde68a 100%);
    background-repeat: no-repeat;
    background-size: 100% 0.3em;
    background-position: 0 88%;
}

.brutal-btn {
    background: var(--ink);
    color: var(--paper);
    padding: 16px 32px;
    border: 2px solid var(--ink);
    font-weight: bold;
    transition: all 0.2s;
}

/* Mobile brutal button */
@media (max-width: 767px) {
    .brutal-btn {
        padding: 12px 24px;
        font-size: 0.875rem;
    }
}

.brutal-btn:hover {
    background: transparent;
    color: var(--ink);
}

.dashed-border {
    border: 2px dashed #d1d5db;
}

/* New Sector Clipping Styles */
.clipping {
    background: white;
    padding: 2rem;
    border: 1px solid #e5e7eb;
    box-shadow: 5px 5px 0px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.clipping:hover {
    transform: translateY(-5px) rotate(1deg);
    box-shadow: 10px 10px 0px rgba(0,0,0,0.1);
}

/* Mobile clipping optimization */
@media (max-width: 767px) {
    .clipping {
        padding: 1.5rem;
        box-shadow: 3px 3px 0px rgba(0,0,0,0.05);
    }
    
    .clipping:hover {
        transform: translateY(-3px) rotate(0.5deg);
        box-shadow: 6px 6px 0px rgba(0,0,0,0.1);
    }
}

.tape {
    background-color: rgba(253, 230, 138, 0.6);
    width: 100px;
    height: 30px;
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%) rotate(-2deg);
    z-index: 10;
}

/* Mobile tape optimization */
@media (max-width: 767px) {
    .tape {
        width: 80px;
        height: 24px;
        top: -12px;
    }
}

/* Gallery specific styles */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

/* Mobile gallery optimization */
@media (max-width: 767px) {
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

.gallery-item {
    background: white;
    padding: 1rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.gallery-item:nth-child(odd) {
    transform: rotate(-1deg);
}

.gallery-item:nth-child(even) {
    transform: rotate(1deg);
}

.gallery-item:hover {
    transform: rotate(0deg) scale(1.05);
}

/* Mobile gallery item optimization */
@media (max-width: 767px) {
    .gallery-item {
        padding: 0.75rem;
        transform: rotate(0deg) !important;
    }
    
    .gallery-item:hover {
        transform: scale(1.02);
    }
}

/* Donation form styles */
.donation-card {
    background: white;
    padding: 2rem;
    border: 2px solid var(--ink);
    box-shadow: 8px 8px 0px rgba(0,0,0,0.1);
}

/* Mobile donation card */
@media (max-width: 767px) {
    .donation-card {
        padding: 1.5rem;
        box-shadow: 4px 4px 0px rgba(0,0,0,0.1);
    }
}

.amount-btn {
    padding: 1rem 2rem;
    border: 2px solid #e5e7eb;
    background: white;
    font-weight: bold;
    transition: all 0.2s;
    cursor: pointer;
}

/* Mobile amount button */
@media (max-width: 767px) {
    .amount-btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.875rem;
    }
}

.amount-btn:hover,
.amount-btn.active {
    background: var(--ink);
    color: white;
    border-color: var(--ink);
}

/* Mobile-specific utilities */
@media (max-width: 767px) {
    .mobile-hidden {
        display: none !important;
    }
    
    .mobile-full-width {
        width: 100% !important;
    }
    
    .mobile-text-center {
        text-align: center !important;
    }
    
    .mobile-px-4 {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    .mobile-py-8 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }
    
    .mobile-mb-8 {
        margin-bottom: 2rem !important;
    }
    
    .mobile-text-sm {
        font-size: 0.875rem !important;
    }
    
    /* Prevent horizontal overflow */
    nav {
        max-width: 100vw;
        overflow-x: hidden;
    }
    
    .max-w-7xl {
        max-width: 100%;
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Ensure buttons fit properly */
    .give-support-btn {
        max-width: calc(100vw - 2rem);
        text-overflow: ellipsis;
        overflow: hidden;
    }
}

/* Touch-friendly interactive elements */
@media (hover: none) and (pointer: coarse) {
    .brutal-btn,
    .give-support-btn,
    .amount-btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .gallery-item:hover {
        transform: none;
    }
    
    .clipping:hover {
        transform: none;
    }
}