/* ============================================
   LifeReceipt - Receipt Component Styles
   ============================================ */

.receipt-section {
    margin-bottom: var(--space-8);
    animation: fadeInUp 0.5s ease-out;
}

.receipt {
    background: var(--receipt-bg);
    color: var(--receipt-text);
    font-family: var(--font-mono);
    padding: var(--space-6);
    border-radius: var(--radius-lg);
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px var(--receipt-shadow);
    overflow: hidden;
    background-image: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0, 0, 0, 0.01) 2px, rgba(0, 0, 0, 0.01) 4px);
}

[data-theme="neon"] .receipt {
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(0, 255, 136, 0.3);
}

.receipt-header {
    text-align: center;
    margin-bottom: var(--space-4);
}

.receipt-store {
    font-size: var(--text-2xl);
    font-weight: 700;
    letter-spacing: 0.15em;
}

.receipt-slogan {
    font-size: var(--text-xs);
    color: #666;
    letter-spacing: 0.1em;
    margin: var(--space-1) 0 var(--space-3);
}

.receipt-date,
.receipt-user {
    font-size: var(--text-sm);
    color: #555;
}

.receipt-user span {
    font-weight: 600;
    color: var(--receipt-text);
}

.receipt-divider {
    text-align: center;
    font-size: var(--text-xs);
    color: #999;
    margin: var(--space-3) 0;
    letter-spacing: -1px;
}

.receipt-divider.dashed {
    color: #bbb;
}

.receipt-body {
    margin: var(--space-4) 0;
}

.receipt-item {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: var(--space-2);
    padding: var(--space-2) 0;
    font-size: var(--text-sm);
    border-bottom: 1px dotted #ddd;
}

.receipt-item:last-child {
    border-bottom: none;
}

.item-name {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-qty {
    color: #666;
    text-align: right;
    min-width: 50px;
}

.item-value {
    text-align: right;
    min-width: 80px;
    font-weight: 600;
}

.item-value.positive {
    color: #00aa66;
}

.item-value.negative {
    color: #dd4444;
}

.receipt-modifiers {
    margin: var(--space-3) 0;
}

.modifier-item {
    display: flex;
    justify-content: space-between;
    font-size: var(--text-xs);
    color: #777;
    padding: var(--space-1) 0;
}

.modifier-item.bonus .modifier-value {
    color: #00aa66;
}

.modifier-item.tax .modifier-value {
    color: #dd4444;
}

.receipt-total {
    text-align: center;
    padding: var(--space-4) 0;
}

.total-label {
    font-size: var(--text-xs);
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: var(--space-2);
}

.total-amount {
    font-size: var(--text-3xl);
    font-weight: 700;
}

.total-amount.positive {
    color: #00aa66;
}

.total-amount.negative {
    color: #dd4444;
}

.total-grade {
    font-size: var(--text-sm);
    margin-top: var(--space-2);
    padding: var(--space-1) var(--space-3);
    display: inline-block;
    border-radius: var(--radius-full);
    font-weight: 600;
}

.total-grade.grade-s {
    background: linear-gradient(135deg, #ffd700, #ffaa00);
    color: #000;
}

.total-grade.grade-a {
    background: #00aa66;
    color: #fff;
}

.total-grade.grade-b {
    background: #0088cc;
    color: #fff;
}

.total-grade.grade-c {
    background: #888;
    color: #fff;
}

.total-grade.grade-d {
    background: #dd4444;
    color: #fff;
}

.receipt-comment,
.receipt-guide {
    margin: var(--space-4) 0;
    padding: var(--space-3);
    background: rgba(0, 0, 0, 0.03);
    border-radius: var(--radius-sm);
}

.comment-label,
.guide-label {
    font-size: var(--text-xs);
    font-weight: 600;
    color: #555;
    margin-bottom: var(--space-2);
}

.comment-text,
.guide-text {
    font-size: var(--text-sm);
    line-height: 1.5;
}

.receipt-footer {
    text-align: center;
    margin-top: var(--space-6);
}

.barcode {
    background: repeating-linear-gradient(90deg, #1a1a1a 0px, #1a1a1a 2px, transparent 2px, transparent 4px, #1a1a1a 4px, #1a1a1a 5px, transparent 5px, transparent 8px);
    height: 50px;
    max-width: 250px;
    margin: 0 auto var(--space-2);
}

.receipt-id {
    font-size: var(--text-xs);
    color: #888;
}

.receipt-powered {
    font-size: var(--text-xs);
    color: #aaa;
    margin-top: var(--space-2);
}

.stamp {
    position: absolute;
    top: 20%;
    right: 10%;
    width: 100px;
    height: 100px;
    border: 4px solid rgba(0, 170, 102, 0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: rotate(-15deg);
    opacity: 0;
    animation: stampAppear 0.5s ease-out 0.5s forwards;
}

.stamp-text {
    font-size: var(--text-sm);
    font-weight: 700;
    color: rgba(0, 170, 102, 0.7);
    text-align: center;
    line-height: 1.2;
}

.stamp.negative {
    border-color: rgba(221, 68, 68, 0.6);
}

.stamp.negative .stamp-text {
    color: rgba(221, 68, 68, 0.7);
}

.receipt-tear {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 20px;
    background: var(--receipt-bg);
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 20'%3E%3Cpath d='M0 0 Q5 10, 10 0 T20 0 T30 0 T40 0 T50 0 T60 0 T70 0 T80 0 T90 0 T100 0 L100 20 L0 20 Z' fill='black'/%3E%3C/svg%3E");
    mask-size: 100% 100%;
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 20'%3E%3Cpath d='M0 0 Q5 10, 10 0 T20 0 T30 0 T40 0 T50 0 T60 0 T70 0 T80 0 T90 0 T100 0 L100 20 L0 20 Z' fill='black'/%3E%3C/svg%3E");
    -webkit-mask-size: 100% 100%;
}

.share-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    justify-content: center;
    margin-top: var(--space-6);
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-full);
    background: var(--bg-card);
    color: var(--text-primary);
    font-family: var(--font-display);
    font-size: var(--text-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base);
}

.share-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.share-btn.save:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.share-btn.copy:hover {
    border-color: var(--accent-tertiary);
    color: var(--accent-tertiary);
}

.share-btn.twitter:hover {
    border-color: #1da1f2;
    color: #1da1f2;
}

.share-btn.reset:hover {
    border-color: var(--accent-secondary);
    color: var(--accent-secondary);
}

@media (max-width: 480px) {
    .receipt {
        padding: var(--space-4);
    }

    .receipt-store {
        font-size: var(--text-xl);
    }

    .total-amount {
        font-size: var(--text-2xl);
    }

    .stamp {
        width: 80px;
        height: 80px;
        right: 5%;
    }

    .share-buttons {
        flex-direction: column;
    }

    .share-btn {
        width: 100%;
        justify-content: center;
    }
}

[data-theme="classic"] .receipt {
    --receipt-shadow: rgba(0, 0, 0, 0.2);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

[data-theme="classic"] .stamp {
    border-color: rgba(0, 0, 0, 0.4);
}

[data-theme="classic"] .stamp-text {
    color: rgba(0, 0, 0, 0.5);
}