/* ============================================
   PAPER TRADE - Pencil Drawing Aesthetic
   ============================================ */

:root {
    --paper-cream: #fdf6e3;
    --paper-white: #fffef9;
    --paper-shadow: #e8dcc8;
    --pencil-gray: #4a4a4a;
    --pencil-light: #7a7a7a;
    --pencil-faint: #b5b5b5;
    --wood-brown: #d4a574;
    --wood-dark: #8b6914;
    --eraser-pink: #ffb6c1;
    --highlight-yellow: #fff59d;
    --line-blue: #a8c8e8;
    --success-green: #90EE90;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Custom pencil cursor */
body {
    font-family: 'Caveat', cursive;
    background: var(--paper-cream);
    color: var(--pencil-gray);
    min-height: 100vh;
    overflow-x: hidden;
    cursor: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><polygon points="4,28 8,18 18,8 24,14 14,24 4,28" fill="%23f4d03f"/><polygon points="18,8 24,14 26,12 20,6 18,8" fill="%238b6914"/><polygon points="4,28 8,18 6,16 2,26 4,28" fill="%23ffb6c1"/><line x1="8" y1="18" x2="18" y2="8" stroke="%234a4a4a" stroke-width="0.5"/></svg>') 2 30, auto;
}

/* Paper background texture */
.paper-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    background:
        repeating-linear-gradient(0deg,
            transparent,
            transparent 31px,
            var(--line-blue) 31px,
            var(--line-blue) 32px),
        linear-gradient(135deg, var(--paper-cream) 0%, var(--paper-white) 50%, var(--paper-cream) 100%);
    opacity: 0.7;
}

/* Floating pencil shavings */
.pencil-shavings {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    overflow: hidden;
}

.shaving {
    position: absolute;
    top: -20px;
    left: var(--x);
    width: 15px;
    height: 8px;
    background: linear-gradient(90deg, var(--wood-brown), var(--wood-dark));
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    animation: fall 15s infinite linear;
    animation-delay: var(--delay);
    opacity: 0.6;
}

@keyframes fall {
    0% {
        transform: translateY(-20px) rotate(0deg);
        opacity: 0;
    }

    10% {
        opacity: 0.6;
    }

    90% {
        opacity: 0.6;
    }

    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* ============================================
   HERO SECTION
   ============================================ */

.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px;
    position: relative;
    background:
        linear-gradient(90deg, transparent 79px, #ddd 79px, #ddd 81px, transparent 81px),
        linear-gradient(var(--paper-cream), var(--paper-cream));
}

/* Notebook holes decoration */
.notebook-holes {
    position: absolute;
    left: 40px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 80px;
}

.hole {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ccc 0%, #999 100%);
    box-shadow:
        inset 2px 2px 4px rgba(0, 0, 0, 0.3),
        inset -1px -1px 2px rgba(255, 255, 255, 0.5);
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 40px;
}

.logo {
    font-size: 4.5rem;
    font-weight: 700;
    letter-spacing: -2px;
    color: var(--pencil-gray);
    text-shadow:
        2px 2px 0 var(--paper-shadow),
        -1px -1px 0 var(--paper-white);
    position: relative;
    display: inline-block;
}

.logo::after {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--pencil-gray);
    transform: skewX(-12deg);
}

.tagline {
    font-family: 'Patrick Hand', cursive;
    font-size: 1.5rem;
    color: var(--pencil-light);
    margin-top: 10px;
    font-style: italic;
}

/* Social Links */
.social-links {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--paper-white);
    border: 2px solid var(--pencil-gray);
    color: var(--pencil-gray);
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 3px 3px 0 var(--pencil-faint);
}

.social-btn:hover {
    transform: translateY(-3px) rotate(-5deg);
    background: var(--highlight-yellow);
    box-shadow: 5px 5px 0 var(--pencil-faint);
}

.social-icon {
    width: 24px;
    height: 24px;
}

/* Main Image Container */
.main-image-container {
    margin: 30px 0;
    perspective: 1000px;
}

.paper-plane {
    position: relative;
    animation: float 4s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0) rotate(-2deg);
    }

    50% {
        transform: translateY(-15px) rotate(2deg);
    }
}

.tilt-wrapper {
    position: relative;
    transform: rotate(-3deg);
    transition: transform 0.3s ease;
}

.tilt-wrapper:hover {
    transform: rotate(0deg) scale(1.02);
}

.main-image {
    max-width: 480px;
    width: 100%;
    border-radius: 4px;
    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.15),
        0 0 0 2px var(--paper-shadow),
        5px 5px 0 var(--pencil-faint);
    background: white;
}

.paper-shadow {
    position: absolute;
    bottom: -20px;
    left: 10%;
    width: 80%;
    height: 30px;
    background: radial-gradient(ellipse, rgba(0, 0, 0, 0.2) 0%, transparent 70%);
    filter: blur(8px);
}

/* CA Container */
.ca-container {
    margin: 40px 0;
    text-align: center;
}

.ca-label {
    font-size: 1.3rem;
    color: var(--pencil-light);
    margin-bottom: 12px;
    font-family: 'Patrick Hand', cursive;
}

.ca-box {
    display: inline-flex;
    align-items: center;
    gap: 15px;
    padding: 16px 28px;
    background: var(--paper-white);
    border: 2px dashed var(--pencil-gray);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.ca-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--highlight-yellow), transparent);
    transition: left 0.5s ease;
}

.ca-box:hover::before {
    left: 100%;
}

.ca-box:hover {
    border-style: solid;
    transform: scale(1.02);
    box-shadow: 4px 4px 0 var(--pencil-faint);
}

.ca-box:active {
    transform: scale(0.98);
}

.ca-text {
    font-family: 'Patrick Hand', cursive;
    font-size: 1.1rem;
    color: var(--pencil-gray);
    word-break: break-all;
    position: relative;
    z-index: 1;
}

.copy-icon {
    font-size: 1.5rem;
    transition: transform 0.3s ease;
}

.ca-box:hover .copy-icon {
    transform: rotate(-20deg);
}

.copy-hint {
    font-size: 0.9rem;
    color: var(--pencil-faint);
    margin-top: 8px;
    font-family: 'Patrick Hand', cursive;
    transition: color 0.3s ease;
}

.ca-box:hover+.copy-hint {
    color: var(--pencil-light);
}

/* Scroll Indicator */
.scroll-indicator {
    margin-top: auto;
    padding-top: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    animation: bounce 2s infinite;
    cursor: pointer;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(10px);
    }
}

.pencil-arrow {
    font-size: 2rem;
    transform: rotate(90deg);
}

.scroll-indicator span {
    font-family: 'Patrick Hand', cursive;
    font-size: 1.2rem;
    color: var(--pencil-light);
}

/* ============================================
   ABOUT SECTION (What is Paper Trading)
   ============================================ */

.about-section {
    min-height: 100vh;
    padding: 80px 20px;
    background:
        linear-gradient(90deg, transparent 79px, #ddd 79px, #ddd 81px, transparent 81px),
        linear-gradient(var(--paper-white), var(--paper-cream));
}

.about-content {
    max-width: 800px;
    margin: 0 auto 60px;
}

.about-text {
    background: var(--paper-white);
    padding: 40px;
    border: 2px solid var(--pencil-faint);
    border-radius: 12px;
    box-shadow:
        8px 8px 0 var(--paper-shadow),
        inset 0 0 30px rgba(0, 0, 0, 0.02);
    position: relative;
}

.about-text::before {
    content: '"';
    position: absolute;
    top: 10px;
    left: 20px;
    font-size: 4rem;
    color: var(--pencil-faint);
    font-family: Georgia, serif;
    line-height: 1;
}

.about-paragraph {
    font-size: 1.5rem;
    line-height: 1.8;
    margin-bottom: 20px;
    text-indent: 30px;
}

.about-paragraph:last-child {
    margin-bottom: 0;
}

.highlight {
    background: linear-gradient(180deg, transparent 60%, var(--highlight-yellow) 60%);
    padding: 0 4px;
}

/* Gallery */
.gallery-header {
    text-align: center;
    margin-bottom: 40px;
}

.gallery-title {
    font-size: 2.5rem;
    color: var(--pencil-gray);
}

.gallery-subtitle {
    font-family: 'Patrick Hand', cursive;
    font-size: 1.2rem;
    color: var(--pencil-light);
    margin-top: 8px;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    max-width: 1200px;
    margin: 0 auto 60px;
    padding: 0 20px;
}

.gallery-item {
    position: relative;
    aspect-ratio: 3/4;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    background: var(--paper-white);
    border: 3px solid var(--pencil-faint);
    box-shadow: 5px 5px 0 var(--paper-shadow);
    transition: all 0.3s ease;
}

.gallery-item:hover {
    transform: translateY(-5px) rotate(-1deg);
    box-shadow: 10px 10px 0 var(--paper-shadow);
    border-color: var(--pencil-gray);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-overlay {
    position: absolute;
    inset: 0;
    background: rgba(74, 74, 74, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-overlay span {
    font-family: 'Patrick Hand', cursive;
    font-size: 1.5rem;
    color: var(--paper-white);
    padding: 10px 25px;
    border: 2px dashed var(--paper-white);
    border-radius: 8px;
}

/* ============================================
   LIGHTBOX
   ============================================ */

.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-image {
    max-width: 90%;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.lightbox.active .lightbox-image {
    transform: scale(1);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 3rem;
    color: white;
    background: none;
    border: none;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.lightbox-close:hover {
    transform: rotate(90deg);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 3rem;
    color: white;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    padding: 20px 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 8px;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

/* ============================================
   CREATOR SECTION
   ============================================ */

.creator-section {
    min-height: 100vh;
    padding: 60px 20px;
    background:
        linear-gradient(90deg, transparent 79px, #ddd 79px, #ddd 81px, transparent 81px),
        linear-gradient(var(--paper-cream), var(--paper-white));
}

.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-title {
    font-size: 3.5rem;
    color: var(--pencil-gray);
    position: relative;
    display: inline-block;
}

.section-title::before,
.section-title::after {
    content: '~';
    margin: 0 20px;
    color: var(--pencil-faint);
}

.section-subtitle {
    font-family: 'Patrick Hand', cursive;
    font-size: 1.3rem;
    color: var(--pencil-light);
    margin-top: 10px;
}

/* Creator Container */
.creator-container {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 40px;
    align-items: start;
}

@media (max-width: 900px) {
    .creator-container {
        grid-template-columns: 1fr;
    }
}

/* Input Panel (now Drawing Tools only) */
.input-panel {
    background: var(--paper-white);
    border: 2px solid var(--pencil-faint);
    border-radius: 12px;
    padding: 25px;
    box-shadow:
        5px 5px 0 var(--paper-shadow),
        inset 0 0 20px rgba(0, 0, 0, 0.02);
}

/* Drawing Tools */
.drawing-tools h3 {
    font-size: 1.5rem;
    color: var(--pencil-gray);
    margin-bottom: 25px;
    text-align: center;
    padding-bottom: 15px;
    border-bottom: 2px dashed var(--pencil-faint);
}

.tool-section {
    margin-bottom: 25px;
}

.tool-section label {
    display: block;
    font-size: 1.1rem;
    color: var(--pencil-light);
    margin-bottom: 10px;
    font-family: 'Patrick Hand', cursive;
}

.tool-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.tool-btn {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    border: 2px solid var(--pencil-faint);
    background: var(--paper-white);
    font-size: 1.4rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tool-btn:hover {
    border-color: var(--pencil-gray);
    transform: scale(1.1);
}

.tool-btn.active {
    border-color: var(--pencil-gray);
    background: var(--highlight-yellow);
    box-shadow: 3px 3px 0 var(--pencil-faint);
}

.size-dot {
    background: var(--pencil-gray);
    border-radius: 50%;
}

/* Color buttons */
.color-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.color-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid var(--paper-white);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.color-btn:hover {
    transform: scale(1.15);
}

.color-btn.active {
    border-color: var(--pencil-gray);
    box-shadow: 0 0 0 3px var(--highlight-yellow);
}

/* Tool Actions */
.tool-actions {
    display: flex;
    gap: 10px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 2px dashed var(--pencil-faint);
}

.action-btn {
    flex: 1;
    padding: 14px;
    font-family: 'Patrick Hand', cursive;
    font-size: 1.1rem;
    color: var(--pencil-gray);
    background: var(--paper-cream);
    border: 2px solid var(--pencil-faint);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-btn:hover {
    border-color: var(--pencil-gray);
    transform: translateY(-2px);
}

.undo-btn:hover {
    background: var(--line-blue);
}

.clear-btn:hover {
    background: var(--eraser-pink);
}

/* Card Wrapper */
.card-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
}

/* Paper Card */
.paper-card {
    position: relative;
    width: 480px;
    max-width: 100%;
    aspect-ratio: 1;
    background: var(--paper-white);
    border-radius: 4px;
    box-shadow:
        0 15px 50px rgba(0, 0, 0, 0.15),
        0 0 0 2px var(--paper-shadow),
        8px 8px 0 var(--pencil-faint);
    overflow: hidden;
    cursor: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><polygon points="4,28 8,18 18,8 24,14 14,24 4,28" fill="%23f4d03f"/><polygon points="18,8 24,14 26,12 20,6 18,8" fill="%238b6914"/><polygon points="4,28 8,18 6,16 2,26 4,28" fill="%23ffb6c1"/><line x1="8" y1="18" x2="18" y2="8" stroke="%234a4a4a" stroke-width="0.5"/></svg>') 2 30, crosshair;
}

#drawingCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
}

.card-content {
    position: relative;
    padding: 40px;
    z-index: 5;
    pointer-events: none;
}

.card-ticker {
    font-size: 2.8rem;
    font-weight: 600;
    color: var(--pencil-gray);
}

.pencil-decoration {
    position: absolute;
    bottom: 30px;
    right: 20px;
    width: 120px;
    height: 25px;
    background: linear-gradient(90deg,
            var(--eraser-pink) 0%,
            var(--eraser-pink) 10%,
            #c9a959 10%,
            #c9a959 15%,
            #f4d03f 15%,
            #f4d03f 85%,
            var(--wood-brown) 85%,
            var(--wood-brown) 95%,
            var(--pencil-gray) 95%);
    border-radius: 3px;
    transform: rotate(25deg);
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.2);
    z-index: 1;
}

/* Export Buttons */
.export-buttons {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.export-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    font-family: 'Patrick Hand', cursive;
    font-size: 1.2rem;
    color: var(--pencil-gray);
    background: var(--paper-white);
    border: 2px solid var(--pencil-gray);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.export-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
    transition: left 0.5s ease;
}

.export-btn:hover::before {
    left: 100%;
}

.export-btn:hover {
    transform: translateY(-3px);
    box-shadow: 4px 4px 0 var(--pencil-faint);
}

.export-btn:active {
    transform: translateY(0);
    box-shadow: none;
}

.copy-btn:hover {
    background: var(--highlight-yellow);
}

.download-btn:hover {
    background: var(--success-green);
}

.btn-icon {
    font-size: 1.4rem;
}

/* ============================================
   FOOTER
   ============================================ */

.footer {
    padding: 50px 20px;
    text-align: center;
    background: var(--paper-cream);
    border-top: 2px dashed var(--pencil-faint);
}

.footer-text {
    font-family: 'Patrick Hand', cursive;
    font-size: 1.4rem;
    color: var(--pencil-light);
}

.footer-ticker {
    color: var(--pencil-gray);
    font-weight: 600;
}

/* ============================================
   TOAST NOTIFICATION
   ============================================ */

.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 14px 28px;
    background: var(--pencil-gray);
    color: var(--paper-white);
    font-family: 'Patrick Hand', cursive;
    font-size: 1.2rem;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: all 0.4s ease;
    z-index: 9999;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 600px) {
    .logo {
        font-size: 3rem;
    }

    .notebook-holes {
        display: none;
    }

    .main-image {
        max-width: 320px;
    }

    .ca-text {
        font-size: 0.9rem;
    }

    .section-title {
        font-size: 2.5rem;
    }

    .section-title::before,
    .section-title::after {
        display: none;
    }

    .paper-card {
        width: 320px;
    }

    .card-ticker {
        font-size: 2rem;
    }

    .about-paragraph {
        font-size: 1.3rem;
    }

    .gallery {
        grid-template-columns: 1fr;
    }

    .lightbox-nav {
        padding: 10px;
        font-size: 2rem;
    }
}