/* CSS Custom Properties for Library Theme */
:root {
    --primary-color: #8B4513;
    --secondary-color: #D2691E;
    --accent-color: #CD853F;
    --text-primary: #2C1810;
    --text-secondary: #5D4E37;
    --text-muted: #8B7355;
    --background-primary: #FFF8DC;
    --background-secondary: #F5DEB3;
    --background-paper: #FFFEF7;
    --border-color: #DEB887;
    --success-color: #228B22;
    --error-color: #B22222;
    --warning-color: #DAA520;
    
    --shadow-light: 0 2px 4px rgba(139, 69, 19, 0.1);
    --shadow-medium: 0 4px 12px rgba(139, 69, 19, 0.15);
    --shadow-heavy: 0 8px 24px rgba(139, 69, 19, 0.2);
    
    --border-radius: 8px;
    --border-radius-large: 12px;
    
    --font-serif: 'Playfair Display', serif;
    --font-body: 'Crimson Text', serif;
}

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

body {
    font-family: var(--font-body);
    background: linear-gradient(135deg, var(--background-primary), var(--background-secondary));
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.library-container {
    max-width: 1400px;
    margin: 0 auto;
    min-height: 100vh;
    background: var(--background-paper);
    box-shadow: var(--shadow-heavy);
}

/* Header Styles */
.library-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.header-content {
    flex: 1;
    min-width: 300px;
}

.library-title {
    font-family: var(--font-serif);
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.library-title i {
    color: var(--accent-color);
}

.library-subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 1rem;
}

.network-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.network-selector label {
    font-weight: 600;
}

.network-selector select {
    padding: 0.5rem;
    border: none;
    border-radius: var(--border-radius);
    background: white;
    color: var(--text-primary);
    font-family: var(--font-body);
}

/* Wallet Section */
.wallet-section {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1rem;
    min-width: 200px;
}

.wallet-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    transition: all 0.3s ease;
}

.wallet-status.connected {
    background: rgba(34, 139, 34, 0.2);
    border: 2px solid rgba(34, 139, 34, 0.3);
}

.wallet-status.disconnected {
    background: rgba(178, 34, 34, 0.2);
    border: 2px solid rgba(178, 34, 34, 0.3);
}

.wallet-status::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

.wallet-info {
    text-align: right;
    font-size: 0.9rem;
    line-height: 1.4;
}

.wallet-info small {
    display: block;
    opacity: 0.8;
    font-weight: 600;
}

.wallet-address {
    margin-bottom: 0.25rem;
}

.connect-btn, .disconnect-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    background: white;
    color: var(--primary-color);
    font-family: var(--font-body);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.connect-btn:hover, .disconnect-btn:hover {
    background: var(--background-secondary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

/* Navigation */
.library-nav {
    background: var(--background-secondary);
    padding: 0;
    display: flex;
    border-bottom: 3px solid var(--border-color);
}

.nav-btn {
    flex: 1;
    padding: 1.25rem 2rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    border-bottom: 3px solid transparent;
}

.nav-btn:hover {
    background: rgba(139, 69, 19, 0.1);
    color: var(--primary-color);
}

.nav-btn.active {
    background: var(--background-paper);
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* Main Content */
.library-main {
    padding: 2rem;
}

.library-section {
    display: none;
}

.library-section.active {
    display: block;
}

.section-header {
    text-align: center;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(139, 69, 19, 0.05), rgba(210, 105, 30, 0.05));
    border-radius: var(--border-radius-large);
    border: 2px solid var(--border-color);
}

.section-header h2 {
    font-family: var(--font-serif);
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

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

/* Content Grid */
.content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

@media (max-width: 968px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
}

/* Card Styles */
.card {
    background: var(--background-paper);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-large);
    padding: 1.5rem;
    box-shadow: var(--shadow-medium);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-heavy);
}

.card h3 {
    font-family: var(--font-serif);
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.3rem;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input[type="text"] {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    background: white;
    font-family: var(--font-body);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(139, 69, 19, 0.1);
}

/* Arguments Section */
.arguments-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--border-color);
}

.arguments-section h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.argument-group {
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--background-secondary);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.argument-controls {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    align-items: center;
}

.arg-type {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: white;
    font-family: var(--font-body);
}

.remove-arg-btn {
    padding: 0.5rem;
    background: var(--error-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

.remove-arg-btn:hover {
    background: #8B0000;
    transform: scale(1.05);
}

.argument-input {
    position: relative;
}

.arg-value, .arg-text-area {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: white;
    font-family: var(--font-body);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.arg-text-area {
    resize: vertical;
    min-height: 120px;
    font-family: 'Courier New', monospace;
    line-height: 1.5;
}

.arg-value:focus, .arg-text-area:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(139, 69, 19, 0.1);
}

.add-arg-btn {
    width: 100%;
    padding: 0.75rem;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-family: var(--font-body);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.add-arg-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

/* Submit Buttons */
.submit-btn {
    width: 100%;
    padding: 1rem 2rem;
    border: none;
    border-radius: var(--border-radius);
    font-family: var(--font-body);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 2rem;
}

.read-btn {
    background: var(--success-color);
    color: white;
}

.read-btn:hover:not(:disabled) {
    background: #1F7A1F;
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.write-btn {
    background: var(--primary-color);
    color: white;
}

.write-btn:hover:not(:disabled) {
    background: #723A10;
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.submit-btn:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
    transform: none;
}

/* Results Display */
.results-display, .transaction-status {
    height: fit-content;
    min-height: 300px;
}

.results-content {
    min-height: 200px;
    max-height: 600px;
    overflow-y: auto;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    color: var(--text-muted);
    text-align: center;
    padding: 2rem;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state p {
    font-size: 1.1rem;
    line-height: 1.6;
}

/* Loading State */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    color: var(--text-secondary);
    text-align: center;
    padding: 2rem;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-left: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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

/* Success Result */
.success-result {
    background: rgba(34, 139, 34, 0.05);
    border: 2px solid rgba(34, 139, 34, 0.2);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.success-result .result-header h4 {
    color: var(--success-color);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.contract-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 1rem;
}

.contract-info small {
    color: var(--text-secondary);
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
}

.result-content h5 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.result-value {
    background: var(--background-paper);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1rem;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    white-space: pre-wrap;
    word-break: break-all;
    overflow-x: auto;
}

.tx-id {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--background-paper);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1rem;
    margin-bottom: 1rem;
}

.tx-id code {
    flex: 1;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    word-break: break-all;
}

.copy-btn {
    padding: 0.5rem;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s ease;
}

.copy-btn:hover {
    background: var(--secondary-color);
}

.tx-actions {
    margin-top: 1rem;
}

.explorer-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    transition: all 0.3s ease;
}

.explorer-link:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

.result-meta {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.result-meta small {
    color: var(--text-muted);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Error Result */
.error-result {
    background: rgba(178, 34, 34, 0.05);
    border: 2px solid rgba(178, 34, 34, 0.2);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.error-result h4 {
    color: var(--error-color);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.error-message p {
    color: var(--text-primary);
    font-weight: 500;
    line-height: 1.5;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--background-paper);
    border-radius: var(--border-radius-large);
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-heavy);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.modal-header h3 {
    color: var(--primary-color);
    font-family: var(--font-serif);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: var(--error-color);
}

.wallet-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.wallet-option {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--background-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-body);
}

.wallet-option:hover {
    background: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.wallet-icon {
    font-size: 2rem;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius);
    background: white;
}

.wallet-details h4 {
    color: var(--primary-color);
    margin-bottom: 0.25rem;
    font-family: var(--font-serif);
}

.wallet-details p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Loading Modal */
.loading-content {
    text-align: center;
    padding: 3rem 2rem;
}

.loading-content .loading-spinner {
    width: 60px;
    height: 60px;
    border-width: 6px;
    margin: 0 auto 2rem;
}

.loading-content h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-family: var(--font-serif);
}

.loading-content p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Notifications */
.notification {
    position: fixed;
    top: 2rem;
    right: 2rem;
    background: var(--background-paper);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--font-body);
    font-weight: 600;
    box-shadow: var(--shadow-heavy);
    z-index: 1001;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    max-width: 400px;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    border-color: var(--success-color);
    color: var(--success-color);
}

.notification.error {
    border-color: var(--error-color);
    color: var(--error-color);
}

.notification i {
    font-size: 1.2rem;
}

/* Platform Description Section */
.platform-description {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #8B4513 100%);
    padding: 4rem 0;
    margin: 2rem 0;
}

.description-card {
    background: rgba(255, 255, 255, 0.95);
    border: none;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.description-content h2 {
    color: var(--primary-color);
    font-size: 2.5rem;
    margin-bottom: 2rem;
    font-family: 'Playfair Display', serif;
}

.description-text {
    font-size: 1.2rem;
    line-height: 1.8;
    color: #444;
    margin-bottom: 1.5rem;
    font-family: 'Crimson Text', serif;
}

/* Reference Tables Section */
.reference-section {
    background: #f8f4e6;
    padding: 4rem 0;
    margin: 2rem 0;
}

.reference-tables-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    margin-bottom: 2rem;
}

.reference-table-card {
    flex: 1 1 400px;
    min-width: 300px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(139, 69, 19, 0.1);
    padding: 2rem;
    border: 2px solid var(--accent-color);
}

.reference-table-card h2 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-family: 'Playfair Display', serif;
}

.contract-address {
    margin: 0.5rem 0 1.5rem;
    font-family: 'Courier New', monospace;
    background: #f0f0f0;
    padding: 0.6rem 0.8rem;
    border-radius: 6px;
    border-left: 4px solid var(--primary-color);
    font-size: 0.9rem;
}

.contract-address code {
    background: none;
    padding: 0;
    color: var(--primary-color);
    font-weight: bold;
}

.table-container {
    overflow-x: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.function-table,
.syntax-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    background: white;
}

.function-table thead tr,
.syntax-table thead tr {
    background: var(--primary-color);
    color: white;
}

.function-table th,
.syntax-table th {
    text-align: left;
    padding: 1rem 0.8rem;
    font-weight: 600;
    font-family: 'Playfair Display', serif;
}

.function-table td,
.syntax-table td {
    padding: 0.8rem;
    border-bottom: 1px solid #e0e0e0;
    vertical-align: top;
    font-family: 'Crimson Text', serif;
    line-height: 1.5;
}

.function-table tbody tr:nth-child(even),
.syntax-table tbody tr:nth-child(even) {
    background: #f9f9f9;
}

.function-table tbody tr:hover,
.syntax-table tbody tr:hover {
    background: #f0f8ff;
    transition: background-color 0.2s ease;
}

.function-table code,
.syntax-table code {
    background: #e8e8e8;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: #d73502;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
    .reference-tables-wrapper {
        flex-direction: column;
    }
    
    .reference-table-card {
        min-width: 100%;
    }
    
    .function-table,
    .syntax-table {
        font-size: 0.8rem;
    }
    
    .function-table th,
    .syntax-table th,
    .function-table td,
    .syntax-table td {
        padding: 0.6rem 0.5rem;
    }
    
    .description-content h2 {
        font-size: 2rem;
    }
    
    .description-text {
        font-size: 1.1rem;
    }

/* Art Gallery Styles */
#gallery-section {
    background: linear-gradient(135deg, #f8f4e6 0%, #ffffff 50%, #f0ede5 100%);
    position: relative;
    overflow: hidden;
}

#gallery-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 30%, rgba(139, 69, 19, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(210, 180, 140, 0.08) 0%, transparent 50%);
    pointer-events: none;
}

#gallery-section .section-header {
    background: linear-gradient(135deg, rgba(139, 69, 19, 0.9) 0%, rgba(160, 82, 45, 0.8) 100%);
    color: white;
    padding: 3rem 2rem;
    margin: -2rem -2rem 3rem -2rem;
    text-align: center;
    position: relative;
    border-radius: 0 0 25px 25px;
    box-shadow: 0 8px 32px rgba(139, 69, 19, 0.3);
}

#gallery-section .section-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.1'%3E%3Cpath d='M30 0l30 30-30 30L0 30z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") repeat;
    opacity: 0.1;
}

#gallery-section .section-header h2 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
}

#gallery-section .section-header p {
    font-size: 1.3rem;
    opacity: 0.9;
    font-style: italic;
    position: relative;
    z-index: 1;
}

/* Enhanced Image Tools Card */
.image-tools {
    background: linear-gradient(145deg, #ffffff 0%, #fefefe 100%);
    border: none;
    border-radius: 20px;
    box-shadow: 
        0 20px 60px rgba(139, 69, 19, 0.15),
        0 8px 25px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    padding: 2.5rem;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.image-tools::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color), var(--secondary-color));
    border-radius: 20px 20px 0 0;
}

.image-tools:hover {
    transform: translateY(-5px);
    box-shadow: 
        0 30px 80px rgba(139, 69, 19, 0.2),
        0 15px 35px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.image-tools h3 {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 2rem;
    margin-bottom: 1rem;
    text-align: center;
}

.tool-description {
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    font-style: italic;
    text-align: center;
    font-size: 1.1rem;
    line-height: 1.6;
}

/* Elegant Section Styling */
.encoder-section,
.decoder-section {
    margin-bottom: 3rem;
    padding: 2rem;
    border-radius: 15px;
    background: linear-gradient(135deg, #fafafa 0%, #f5f5f5 100%);
    border: 1px solid rgba(139, 69, 19, 0.1);
    position: relative;
    transition: all 0.3s ease;
}

.encoder-section::before,
.decoder-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent-color), transparent);
    border-radius: 15px 15px 0 0;
}

.encoder-section:hover,
.decoder-section:hover {
    box-shadow: 0 10px 30px rgba(139, 69, 19, 0.1);
    transform: translateY(-2px);
}

.encoder-section h4,
.decoder-section h4 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    text-align: center;
    position: relative;
}

.encoder-section h4::after,
.decoder-section h4::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-color), transparent);
}

/* Stunning File Drop Zone */
.file-drop-zone {
    border: 3px dashed transparent;
    border-radius: 20px;
    padding: 3rem 2rem;
    text-align: center;
    background: 
        linear-gradient(white, white) padding-box,
        linear-gradient(135deg, var(--accent-color), var(--primary-color), var(--secondary-color)) border-box;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.file-drop-zone::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(139, 69, 19, 0.05) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.file-drop-zone:hover::before,
.file-drop-zone.dragover::before {
    opacity: 1;
}

.file-drop-zone:hover,
.file-drop-zone.dragover {
    transform: scale(1.02);
    box-shadow: 
        0 15px 40px rgba(139, 69, 19, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.file-drop-zone i {
    font-size: 4rem;
    background: linear-gradient(135deg, var(--accent-color), var(--primary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1.5rem;
    display: block;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.file-drop-zone p {
    margin: 0.8rem 0;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 1.1rem;
}

.file-info {
    font-size: 0.95rem;
    color: var(--text-muted);
    background: rgba(139, 69, 19, 0.05);
    padding: 0.5rem 1rem;
    border-radius: 25px;
    display: inline-block;
    margin-top: 0.5rem;
}

/* Beautiful Image Preview */
.image-preview {
    text-align: center;
    margin: 2rem 0;
    padding: 2rem;
    border-radius: 15px;
    background: linear-gradient(135deg, #ffffff 0%, #f9f9f9 100%);
    box-shadow: 
        0 10px 30px rgba(139, 69, 19, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transform: scale(0.95);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.image-preview.show {
    transform: scale(1);
    opacity: 1;
}

.image-preview img {
    max-width: 100%;
    max-height: 250px;
    border-radius: 12px;
    box-shadow: 
        0 15px 35px rgba(0, 0, 0, 0.15),
        0 5px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.image-preview img:hover {
    transform: scale(1.05);
    box-shadow: 
        0 20px 45px rgba(0, 0, 0, 0.2),
        0 8px 20px rgba(0, 0, 0, 0.12);
}

.image-info {
    margin-top: 1.5rem;
    font-size: 0.95rem;
    color: var(--text-secondary);
    background: rgba(139, 69, 19, 0.05);
    padding: 1rem;
    border-radius: 10px;
}

.image-info span {
    display: block;
    margin: 0.5rem 0;
    font-weight: 500;
}

/* Sophisticated Action Buttons */
.action-btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 25px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    margin: 1rem 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    box-shadow: 
        0 8px 25px rgba(139, 69, 19, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

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

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

.action-btn:hover:not(:disabled) {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 
        0 15px 40px rgba(139, 69, 19, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.action-btn:active {
    transform: translateY(-1px) scale(1.02);
}

.action-btn:disabled {
    background: linear-gradient(135deg, #ccc 0%, #bbb 100%);
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.copy-btn {
    background: linear-gradient(135deg, var(--accent-color) 0%, #e67e22 100%);
    color: white;
    border: none;
    padding: 0.7rem 1.5rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(230, 126, 34, 0.3);
}

.copy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(230, 126, 34, 0.4);
}

/* Enhanced Output Sections */
.output-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8f8f8 0%, #ffffff 100%);
    border-radius: 15px;
    border: 1px solid rgba(139, 69, 19, 0.1);
    animation: slideInUp 0.4s ease-out;
}

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

.output-section label {
    display: block;
    margin-bottom: 1rem;
    font-weight: 600;
    color: var(--primary-color);
    font-size: 1.1rem;
    text-align: center;
}

.output-section textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid rgba(139, 69, 19, 0.1);
    border-radius: 10px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    resize: vertical;
    background: white;
    transition: all 0.3s ease;
    line-height: 1.5;
}

.output-section textarea:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 20px rgba(139, 69, 19, 0.1);
    outline: none;
}

/* Elegant Decoded Image Container */
.decoded-image-container {
    text-align: center;
    padding: 2rem;
    border-radius: 15px;
    background: linear-gradient(135deg, #ffffff 0%, #f9f9f9 100%);
    box-shadow: 
        0 10px 30px rgba(139, 69, 19, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    animation: fadeInScale 0.5s ease-out;
}

@keyframes fadeInScale {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.decoded-image-container img {
    max-width: 100%;
    max-height: 400px;
    border-radius: 12px;
    box-shadow: 
        0 15px 35px rgba(0, 0, 0, 0.15),
        0 5px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.decoded-image-container img:hover {
    transform: scale(1.03);
    box-shadow: 
        0 20px 45px rgba(0, 0, 0, 0.2),
        0 8px 20px rgba(0, 0, 0, 0.12);
}

.image-actions {
    margin-top: 2rem;
}

@media (max-width: 768px) {
    .library-header {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .wallet-section {
        align-items: center;
    }
    
    .library-title {
        font-size: 2rem;
        justify-content: center;
    }
    
    .nav-btn {
        font-size: 1rem;
        padding: 1rem;
    }
    
    .library-main {
        padding: 1rem;
    }
    
    .modal-content {
        padding: 1.5rem;
        width: 95%;
    }
    
    .wallet-option {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }
    
    .notification {
        top: 1rem;
        right: 1rem;
        left: 1rem;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .library-title {
        font-size: 1.5rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .content-grid {
        gap: 1rem;
    }
    
    .card {
        padding: 1rem;
    }
    
    .tx-id {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .tx-id code {
        font-size: 0.8rem;
    }
}

/* Print Styles */
@media print {
    .library-header,
    .library-nav,
    .modal,
    .notification {
        display: none !important;
    }
    
    .library-container {
        box-shadow: none;
    }
    
    .card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
}
