:root {
    --bg-dark: #0f172a;
    --bg-darker: #020617;
    --cheese-gold: #fbbf24;
    --cheese-yellow: #fde047;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --accent-glow: rgba(251, 191, 36, 0.3);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-darker);
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(251, 191, 36, 0.08), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(253, 224, 71, 0.05), transparent 25%);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
}

.app-container {
    display: flex;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

/* Sidebar Navigation */
.sidebar {
    width: 280px;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border-right: 1px solid var(--glass-border);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: sticky;
    top: 0;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--cheese-gold);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 3rem;
    text-shadow: 0 0 15px var(--accent-glow);
}

.nav-links {
    list-style: none;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-links li {
    padding: 1rem 1.25rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-muted);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-links li:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    transform: translateX(5px);
}

.nav-links li.active {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.1), rgba(253, 224, 71, 0.2));
    color: var(--cheese-yellow);
    border-left: 3px solid var(--cheese-gold);
    box-shadow: 0 4px 15px var(--accent-glow);
}

.sidebar-footer {
    margin-top: auto;
}

.btn-outline {
    width: 100%;
    padding: 0.75rem;
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.btn-outline:hover {
    border-color: var(--cheese-gold);
    color: var(--cheese-gold);
    background: rgba(251, 191, 36, 0.05);
}

.btn-primary {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--cheese-gold), var(--cheese-yellow));
    border: none;
    color: var(--bg-darker);
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 800;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(251, 191, 36, 0.4);
}

/* Main Content */
.main-content {
    flex-grow: 1;
    padding: 4rem;
    display: flex;
    flex-direction: column;
}

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 3rem;
    gap: 2rem;
}

.header-title {
    max-width: 60%;
}

.main-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, var(--text-main), var(--cheese-yellow));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.main-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.search-container {
    flex-grow: 1;
    max-width: 400px;
    margin-top: 0.5rem;
}

.search-box {
    display: flex;
    align-items: center;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 0.35rem 0.35rem 0.35rem 1rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.search-box:focus-within {
    border-color: var(--cheese-gold);
    box-shadow: 0 4px 15px var(--accent-glow);
    background: rgba(30, 41, 59, 0.9);
}

.search-icon {
    color: var(--text-muted);
    margin-right: 0.75rem;
}

.search-box input {
    flex-grow: 1;
    background: transparent;
    border: none;
    color: var(--text-main);
    padding: 0.5rem 0;
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    width: 100%;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.btn-small {
    padding: 0.5rem 1.25rem;
    font-size: 0.9rem;
}

.verification-success, .verification-error {
    text-align: center;
    padding: 1rem 0;
}

.verification-success .icon {
    font-size: 4rem;
    color: #10b981;
    margin-bottom: 1.5rem;
}

.verification-error .icon {
    font-size: 4rem;
    color: #ef4444;
    margin-bottom: 1.5rem;
}

.result-details {
    background: rgba(0,0,0,0.3);
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 1.5rem;
    text-align: left;
    border: 1px solid var(--glass-border);
}

.result-details p {
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.result-details span {
    color: var(--text-main);
    font-family: monospace;
    display: block;
    margin-top: 0.25rem;
    word-break: break-all;
}

.upload-section {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-grow: 1;
    min-height: 400px;
}

.dropzone {
    width: 100%;
    max-width: 600px;
    height: 350px;
    background: var(--glass-bg);
    border: 2px dashed var(--glass-border);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(10px);
}

.dropzone:hover, .dropzone.dragover {
    border-color: var(--cheese-gold);
    background: rgba(251, 191, 36, 0.05);
    transform: scale(1.02);
    box-shadow: 0 10px 30px var(--accent-glow);
}

.drop-icon {
    font-size: 4rem;
    color: var(--cheese-gold);
    margin-bottom: 1rem;
    transition: transform 0.3s ease;
}

.dropzone:hover .drop-icon {
    transform: translateY(-10px);
}

.dropzone h2 {
    font-weight: 600;
}

.dropzone p {
    color: var(--text-muted);
}

/* Processing Area */
.processing-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
    text-align: center;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--glass-border);
    border-top: 4px solid var(--cheese-gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 2rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Result Area */
.result-area {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 3rem;
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
    backdrop-filter: blur(10px);
    animation: slideUp 0.5s ease;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.success-icon {
    font-size: 4rem;
    color: #10b981;
    margin-bottom: 1.5rem;
}

.result-area h3 {
    font-size: 1.8rem;
    margin-bottom: 2rem;
}

.hash-box, .tx-box {
    background: rgba(0, 0, 0, 0.3);
    padding: 1.25rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    text-align: left;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.hash-box label, .tx-box label {
    font-size: 0.85rem;
    color: var(--cheese-gold);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: block;
    margin-bottom: 0.5rem;
}

.hash-value, .tx-value {
    font-family: monospace;
    font-size: 1.1rem;
    word-break: break-all;
    color: var(--text-main);
}

.result-area .btn-primary {
    margin-top: 1rem;
}

.stamp-status-note {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.hidden {
    display: none !important;
}

/* Modal */
.modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal.show {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: var(--bg-dark);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    padding: 2.5rem;
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s ease;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.modal.show .modal-content {
    transform: translateY(0);
}

.close-btn {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-btn:hover {
    color: var(--text-main);
}

.modal-content h2 {
    margin-bottom: 2rem;
    color: var(--cheese-gold);
}

/* On-Page Instructions */
.on-page-instructions {
    margin-top: 4rem;
    padding-top: 3rem;
    border-top: 1px solid var(--glass-border);
}

.on-page-instructions h2 {
    color: var(--cheese-gold);
    margin-bottom: 2rem;
    font-size: 1.8rem;
    text-align: center;
}

.instruction-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.instruction-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.instruction-card:hover {
    border-color: var(--cheese-gold);
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}

.step-number {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.1), rgba(253, 224, 71, 0.2));
    color: var(--cheese-gold);
    border: 1px solid var(--cheese-gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.2rem;
    margin-bottom: 1rem;
    box-shadow: 0 0 15px var(--accent-glow);
}

.instruction-card h4 {
    color: var(--text-main);
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

.instruction-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    flex-grow: 1;
}

.instruction-card strong {
    color: #34d399;
}

/* Responsive */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--glass-border);
        padding: 1rem;
        position: static;
    }
    
    .logo {
        margin-bottom: 1rem;
    }
    
    .nav-links {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 0.5rem;
    }
    
    .nav-links li {
        white-space: nowrap;
    }
    
    .sidebar-footer {
        margin-top: 1rem;
    }
    
    .main-content {
        padding: 2rem 1rem;
    }
    
    .dropzone {
        height: 250px;
    }
}

/* P2P Transfer Styles */
.share-link-container {
    margin-top: 0.5rem;
}

.glass-input {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-main);
    padding: 0.75rem 1rem;
    outline: none;
    transition: all 0.3s ease;
}

.glass-input:focus {
    border-color: var(--cheese-gold);
    background: rgba(0, 0, 0, 0.5);
}

.progress-bar-container {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
}

.progress-bar {
    height: 100%;
    background: linear-gradient(to right, var(--cheese-gold), #10b981);
    width: 0%;
    transition: width 0.3s ease;
}

.spinner.small {
    width: 30px;
    height: 30px;
    border-width: 3px;
}

.file-info-box p {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.file-info-box strong {
    color: var(--cheese-gold);
}

/* History Section Styles */
.history-section {
    margin-top: 4rem;
    padding-top: 3rem;
    border-top: 1px solid var(--glass-border);
    width: 100%;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.history-header h2 {
    color: var(--cheese-gold);
    font-size: 1.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

/* Custom Scrollbar for History List */
.history-list::-webkit-scrollbar {
    width: 6px;
}

.history-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

.history-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.history-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

.history-item {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

.history-item:hover {
    border-color: rgba(251, 191, 36, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.history-item-left {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-grow: 1;
    min-width: 0;
}

.history-item-icon {
    font-size: 1.8rem;
    color: var(--cheese-gold);
    flex-shrink: 0;
    width: 45px;
    height: 45px;
    background: rgba(251, 191, 36, 0.05);
    border: 1px solid rgba(251, 191, 36, 0.1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.history-item-details {
    min-width: 0;
}

.history-item-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-main);
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-item-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.history-item-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.history-item-meta .meta-hash {
    font-family: monospace;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
}

.history-item-meta .meta-hash:hover {
    color: var(--cheese-gold);
}

/* Status Badges */
.status-badge {
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid transparent;
    display: inline-block;
    white-space: nowrap;
}

.status-badge.confirmed {
    color: #10b981;
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.2);
}

.status-badge.pending {
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.08);
    border-color: rgba(251, 191, 36, 0.2);
}

.status-badge.hash-only {
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.2);
}

.history-item-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.history-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.history-btn:hover {
    background: rgba(251, 191, 36, 0.1);
    color: var(--cheese-gold);
    border-color: var(--cheese-gold);
}

.history-btn.delete-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border-color: #ef4444;
}

/* Duplicate Alert System */
.duplicate-alert {
    background: rgba(251, 191, 36, 0.08);
    border: 1px solid rgba(251, 191, 36, 0.25);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    text-align: left;
    animation: pulseBorder 2s infinite alternate;
}

@keyframes pulseBorder {
    from { border-color: rgba(251, 191, 36, 0.2); }
    to { border-color: rgba(251, 191, 36, 0.5); }
}

.duplicate-alert-icon {
    font-size: 2.2rem;
    color: var(--cheese-gold);
    flex-shrink: 0;
}

.duplicate-alert-content {
    flex-grow: 1;
}

.duplicate-alert-content h4 {
    color: var(--cheese-gold);
    font-weight: 700;
    font-size: 1.05rem;
    margin-bottom: 0.25rem;
}

.duplicate-alert-content p {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.4;
    margin: 0;
}

/* Empty Placeholder style */
.history-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.01);
    border: 1px dashed var(--glass-border);
    border-radius: 12px;
    font-style: italic;
    font-size: 0.9rem;
}


