/* 
 * VeriCharm Stylesheet
 * Anti-counterfeiting platform, with renewable energy application focus for BOS Hackathon 
 */

:root {
    --primary: #5A6C7D;
    --secondary: #7A8B5A;
    --accent: #B58B70;
    --energy-accent: #4A9C8A;
    --light: #F9F8F5;
    --dark: #2D3748;
    --gray: #718096;
    --success: #38A169;
    --warning: #D69E2E;
    --error: #E53E3E;
    --transition: all 0.3s ease;
    --card-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
    --hover-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: 'Source Sans Pro', sans-serif;
    background-color: var(--light);
    color: var(--dark);
    line-height: 1.6;
    min-height: 100vh;
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(122, 139, 90, 0.03) 0%, transparent 55%),
        radial-gradient(circle at 85% 30%, rgba(90, 108, 125, 0.03) 0%, transparent 55%);
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Styles */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid rgba(90, 108, 125, 0.1);
    margin-bottom: 30px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    box-shadow: 0 4px 12px rgba(90, 108, 125, 0.15);
}

.logo-text h1 {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 24px;
    color: var(--primary);
    letter-spacing: -0.5px;
}

.logo-text p {
    font-size: 14px;
    color: var(--gray);
    letter-spacing: 0.3px;
}

.wallet-display {
    background-color: white;
    border-radius: 16px;
    padding: 18px 24px;
    box-shadow: var(--card-shadow);
    border: 1px solid rgba(90, 108, 125, 0.08);
    transition: var(--transition);
}

.wallet-display:hover {
    box-shadow: var(--hover-shadow);
}

.wallet-balance {
    display: flex;
    align-items: center;
    gap: 10px;
}

.balance-amount {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 18px;
    color: var(--dark);
}

.balance-label {
    font-size: 14px;
    color: var(--gray);
}

/* Navigation */
.nav-tabs {
    display: flex;
    background-color: white;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 30px;
    box-shadow: var(--card-shadow);
    border: 1px solid rgba(90, 108, 125, 0.08);
}

.nav-tab {
    flex: 1;
    text-align: center;
    padding: 20px;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 16px;
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 3px solid transparent;
    color: var(--gray);
}

.nav-tab:hover {
    background-color: rgba(90, 108, 125, 0.04);
    color: var(--primary);
}

.nav-tab.active {
    border-bottom: 3px solid var(--energy-accent);
    color: var(--energy-accent);
    background-color: rgba(74, 156, 138, 0.04);
}

/* Tab Content */
.tab-content {
    display: none;
    animation: fadeIn 0.5s ease;
}

.tab-content.active {
    display: block;
}

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

/* Section Titles */
.section-title {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 28px;
    color: var(--primary);
    margin-bottom: 25px;
}

.explorer-title {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 22px;
    color: var(--primary);
}

/* Product Cards */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.product-card {
    background-color: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    border: 1px solid rgba(90, 108, 125, 0.08);
    position: relative;
}

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

.product-image {
    height: 200px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.product-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0) 70%, rgba(0,0,0,0.05) 100%);
}

.product-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255,255,255,0.9);
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    color: var(--primary);
}

.energy-badge {
    color: var(--energy-accent);
}

.product-category {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gray);
    margin-bottom: 8px;
    font-weight: 500;
}

.product-name {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 20px;
    color: var(--dark);
    margin-bottom: 5px;
    line-height: 1.3;
}

.product-retailer {
    font-size: 14px;
    color: var(--primary);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.product-retailer i {
    font-size: 12px;
}

.product-price {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 24px;
    color: var(--energy-accent);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.product-price::before {
    content: '$';
    font-size: 18px;
    opacity: 0.8;
}

/* Buttons */
.btn {
    padding: 15px 24px;
    border-radius: 12px;
    border: none;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--energy-accent), var(--secondary));
    color: white;
    box-shadow: 0 4px 12px rgba(74, 156, 138, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(74, 156, 138, 0.3);
}

.btn-primary:disabled {
    background: #CBD5E0;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background-color: white;
    color: var(--primary);
    border: 1px solid rgba(90, 108, 125, 0.3);
}

.btn-secondary:hover {
    background-color: rgba(90, 108, 125, 0.05);
}

.btn-small {
    padding: 8px 16px;
    font-size: 14px;
}

.btn-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Directory Styles */
.directory-container {
    background-color: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: var(--card-shadow);
    border: 1px solid rgba(90, 108, 125, 0.08);
}

.directory-section {
    margin-bottom: 40px;
}

.directory-section h2 {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 22px;
    color: var(--primary);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(90, 108, 125, 0.1);
    display: flex;
    align-items: center;
    gap: 10px;
}

.address-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.address-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px;
    background-color: rgba(90, 108, 125, 0.03);
    border-radius: 12px;
    border: 1px solid rgba(90, 108, 125, 0.1);
    transition: var(--transition);
}

.address-item:hover {
    background-color: rgba(90, 108, 125, 0.05);
}

.address-info h4 {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 5px;
    color: var(--dark);
}

.address-info p {
    font-size: 14px;
    color: var(--gray);
}

.eco-note {
    color: var(--energy-accent);
}

.address-value {
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    background-color: rgba(90, 108, 125, 0.05);
    padding: 8px 12px;
    border-radius: 8px;
    color: var(--dark);
    border: 1px solid rgba(90, 108, 125, 0.1);
}

/* Explorer Styles */
.explorer-container {
    background-color: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: var(--card-shadow);
    border: 1px solid rgba(90, 108, 125, 0.08);
}

.explorer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.privacy-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toggle-label {
    font-size: 14px;
    color: var(--gray);
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #CBD5E0;
    transition: .4s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: var(--energy-accent);
}

input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

.transaction-history {
    border: 1px solid rgba(90, 108, 125, 0.1);
    border-radius: 12px;
    overflow: hidden;
}

.transaction-item {
    display: flex;
    padding: 18px;
    border-bottom: 1px solid rgba(90, 108, 125, 0.1);
    align-items: center;
    gap: 15px;
    transition: var(--transition);
}

.transaction-item:hover {
    background-color: rgba(90, 108, 125, 0.03);
}

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

.transaction-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.icon-mint {
    background: linear-gradient(135deg, var(--primary), #6D7B93);
}

.icon-transfer {
    background: linear-gradient(135deg, var(--secondary), #8A9A5B);
}

.icon-burn {
    background: linear-gradient(135deg, var(--accent), #CC7357);
}

.icon-payment {
    background: linear-gradient(135deg, #805AD5, #9F7AEA);
}

.icon-energy {
    background: linear-gradient(135deg, var(--energy-accent), #5BBF9A);
}

.transaction-details {
    flex-grow: 1;
}

.transaction-details h4 {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 5px;
    color: var(--dark);
}

.transaction-details p {
    font-size: 14px;
    color: var(--gray);
}

.transaction-address {
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 12px;
    background-color: rgba(90, 108, 125, 0.05);
    padding: 6px 10px;
    border-radius: 6px;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    border: 1px solid rgba(90, 108, 125, 0.1);
    margin-top: 4px;
}

.transaction-time {
    font-size: 12px;
    color: var(--gray);
    white-space: nowrap;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    backdrop-filter: blur(4px);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background-color: white;
    border-radius: 20px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.4s ease;
    border: 1px solid rgba(90, 108, 125, 0.1);
}

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

.modal-header {
    padding: 25px 30px 15px;
    border-bottom: 1px solid rgba(90, 108, 125, 0.1);
}

.modal-header h2 {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 22px;
    color: var(--dark);
}

.modal-content {
    padding: 25px 30px;
}

.modal-footer {
    padding: 20px 30px;
    border-top: 1px solid rgba(90, 108, 125, 0.1);
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

/* Success Modal Content */
.success-content {
    text-align: center;
    padding: 20px 0;
}

.success-icon {
    font-size: 48px;
    color: var(--success);
    margin-bottom: 20px;
}

.success-title {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 22px;
    color: var(--dark);
    margin-bottom: 15px;
}

.success-message {
    color: var(--gray);
    margin-bottom: 25px;
}

/* Alert Styles */
.alert {
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    border: 1px solid transparent;
}

.alert-error {
    background-color: rgba(229, 62, 62, 0.08);
    border-color: rgba(229, 62, 62, 0.2);
    color: var(--error);
}

.alert-warning {
    background-color: rgba(214, 158, 46, 0.08);
    border-color: rgba(214, 158, 46, 0.2);
    color: var(--warning);
}

.alert-success {
    background-color: rgba(56, 161, 105, 0.08);
    border-color: rgba(56, 161, 105, 0.2);
    color: var(--success);
}

.alert-info {
    background-color: rgba(90, 108, 125, 0.08);
    border-color: rgba(90, 108, 125, 0.2);
    color: var(--primary);
}

.alert-energy {
    background-color: rgba(74, 156, 138, 0.08);
    border-color: rgba(74, 156, 138, 0.2);
    color: var(--energy-accent);
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 8px;
    color: var(--dark);
}

.form-control {
    width: 100%;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid rgba(90, 108, 125, 0.2);
    font-family: 'Source Sans Pro', sans-serif;
    font-size: 16px;
    transition: var(--transition);
    background-color: white;
}

.form-control:focus {
    outline: none;
    border-color: var(--energy-accent);
    box-shadow: 0 0 0 3px rgba(74, 156, 138, 0.1);
}

.form-readonly {
    background-color: rgba(90, 108, 125, 0.05);
    color: var(--gray);
    border-color: rgba(90, 108, 125, 0.1);
}

.form-hint {
    color: var(--gray);
    font-size: 13px;
    margin-top: 5px;
    display: block;
}

/* Token Management */
.token-management {
    background-color: white;
    border-radius: 20px;
    padding: 30px;
    margin-top: 30px;
    box-shadow: var(--card-shadow);
    border: 1px solid rgba(90, 108, 125, 0.08);
}

.token-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.detail-card {
    background-color: rgba(90, 108, 125, 0.03);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid rgba(90, 108, 125, 0.1);
    transition: var(--transition);
}

.detail-card:hover {
    background-color: rgba(90, 108, 125, 0.05);
}

.detail-card h4 {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 14px;
    color: var(--gray);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-card p {
    font-size: 18px;
    color: var(--dark);
    font-weight: 500;
}

.action-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

/* Token List */
.token-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}

.token-item {
    background-color: white;
    border: 1px solid rgba(90, 108, 125, 0.1);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.token-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: rgba(90, 108, 125, 0.2);
}

.token-info h4 {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 5px;
}

.token-info p {
    font-size: 14px;
    color: var(--gray);
}

.token-actions {
    display: flex;
    gap: 10px;
}

/* Responsive */
@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .nav-tabs {
        flex-direction: column;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .token-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .token-actions {
        width: 100%;
    }
    
    .explorer-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .address-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .address-value {
        width: 100%;
        max-width: none;
    }
}
