/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    line-height: 1.6;
    color: #1a4d2e;
    background: linear-gradient(135deg, #a8e6cf 0%, #dcedc1 50%, #ffd3b6 100%);
    min-height: 100vh;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2d6a4f;
    text-decoration: none;
}

.wallet-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.wallet-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(168, 230, 207, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: 1px solid rgba(45, 106, 79, 0.3);
}

.wallet-address {
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.875rem;
    color: #1a4d2e;
}

/* Main Content */
.main {
    padding: 2rem 0;
    min-height: calc(100vh - 140px);
}

/* Cards */
.card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    overflow: hidden;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.15);
}

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(226, 232, 240, 0.5);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(247, 250, 252, 0.5);
}

.card-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a4d2e;
}

.card-body {
    padding: 1.5rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 44px;
    gap: 0.5rem;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, #52b788, #40916c);
    color: white;
    box-shadow: 0 4px 12px rgba(64, 145, 108, 0.3);
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #40916c, #2d6a4f);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(45, 106, 79, 0.4);
}

.btn-secondary {
    background: #e2e8f0;
    color: #4a5568;
    border: 1px solid #cbd5e0;
}

.btn-secondary:hover:not(:disabled) {
    background: #cbd5e0;
}

.btn-success {
    background: linear-gradient(135deg, #74c69d, #52b788);
    color: white;
    box-shadow: 0 4px 12px rgba(82, 183, 136, 0.3);
}

.btn-success:hover:not(:disabled) {
    background: linear-gradient(135deg, #52b788, #40916c);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(82, 183, 136, 0.4);
}

.btn-outline {
    background: transparent;
    color: #2d6a4f;
    border: 1px solid #2d6a4f;
}

.btn-outline:hover:not(:disabled) {
    background: #2d6a4f;
    color: white;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    min-height: 36px;
}

.btn-full {
    width: 100%;
}

/* Status Elements */
.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: rgba(247, 250, 252, 0.5);
    border-radius: 8px;
    border: 1px solid rgba(226, 232, 240, 0.5);
}

.label {
    font-weight: 500;
    color: #4a5568;
}

.value {
    font-weight: 600;
    color: #1a4d2e;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.875rem;
}

/* Cycle Status */
.cycle-status {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.status-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
    background: #e2e8f0;
    color: #4a5568;
}

.status-badge.active {
    background: linear-gradient(135deg, #52b788, #74c69d);
    color: white;
}

.status-badge.inactive {
    background: #fed7d7;
    color: #c53030;
}

.time-remaining {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.time-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.time-label {
    font-size: 0.875rem;
    color: #4a5568;
}

.time-value {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1a4d2e;
}

/* Verification Status */
.verification-status {
    margin-bottom: 1rem;
}

.status-message {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-weight: 500;
    text-align: center;
}

.status-message.verified {
    background: #d8f3dc;
    color: #1b4332;
    border: 1px solid #95d5b2;
}

.status-message.unverified {
    background: #fed7d7;
    color: #742a2a;
    border: 1px solid #fc8181;
}

.verification-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.stat-item {
    text-align: center;
    padding: 1rem;
    background: rgba(247, 250, 252, 0.5);
    border-radius: 8px;
    border: 1px solid rgba(226, 232, 240, 0.5);
}

.stat-label {
    display: block;
    font-size: 0.875rem;
    color: #4a5568;
    margin-bottom: 0.25rem;
}

.stat-value {
    display: block;
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a4d2e;
}

/* Forms */
.form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-label {
    font-weight: 500;
    color: #1a4d2e;
    font-size: 0.875rem;
}

.form-input,
.form-select {
    padding: 0.75rem 1rem;
    border: 1px solid #cbd5e0;
    border-radius: 8px;
    font-size: 0.875rem;
    background: white;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: #52b788;
    box-shadow: 0 0 0 3px rgba(82, 183, 136, 0.1);
}

.form-range {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: #e2e8f0;
    outline: none;
    cursor: pointer;
}

.form-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #52b788, #74c69d);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(82, 183, 136, 0.3);
}

.form-range::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #52b788, #74c69d);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(82, 183, 136, 0.3);
}

.range-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    color: #4a5568;
}

.confidence-value {
    font-weight: 600;
    color: #2d6a4f;
    font-size: 1rem;
}

.form-help {
    font-size: 0.8rem;
    color: #718096;
}

/* Results */
.results-controls {
    display: flex;
    gap: 1rem;
    align-items: end;
    margin-bottom: 1.5rem;
}

.results-controls .form-group {
    flex: 1;
    margin-bottom: 0;
}

.results-content {
    padding: 1rem;
    background: rgba(247, 250, 252, 0.5);
    border-radius: 8px;
    border: 1px solid rgba(226, 232, 240, 0.5);
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(226, 232, 240, 0.3);
}

.result-item:last-child {
    border-bottom: none;
}

.result-label {
    font-weight: 500;
    color: #4a5568;
}

.result-value {
    font-weight: 600;
    color: #1a4d2e;
}

.result-value.hash {
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.8rem;
    word-break: break-all;
    max-width: 300px;
    text-align: right;
}

/* Transaction History */
.transaction-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 400px;
    overflow-y: auto;
}

.transaction-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: rgba(247, 250, 252, 0.5);
    border-radius: 8px;
    border: 1px solid rgba(226, 232, 240, 0.5);
}

.transaction-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.transaction-type {
    font-weight: 500;
    color: #1a4d2e;
}

.transaction-hash {
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.8rem;
    color: #4a5568;
}

.transaction-status {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.transaction-status.success {
    background: #d8f3dc;
    color: #1b4332;
}

.transaction-status.pending {
    background: #fef5e7;
    color: #744210;
}

.transaction-status.failed {
    background: #fed7d7;
    color: #742a2a;
}

.empty-state {
    text-align: center;
    padding: 2rem;
    color: #718096;
    font-style: italic;
}

/* Control Buttons */
.control-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.owner-badge {
    padding: 0.25rem 0.75rem;
    background: linear-gradient(135deg, #ffb347, #ff8c42);
    color: white;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Footer */
.footer {
    background: rgba(26, 77, 46, 0.95);
    color: white;
    padding: 1.5rem 0;
    margin-top: auto;
    backdrop-filter: blur(10px);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-link {
    color: #cbd5e0;
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: white;
}

/* Loading Overlay */
.loading-overlay {
    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;
    backdrop-filter: blur(4px);
}

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #52b788;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Notification */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1001;
    max-width: 400px;
    animation: slideIn 0.3s ease-out;
}

.notification-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border-left: 4px solid #52b788;
}

.notification.error .notification-content {
    border-left-color: #e53e3e;
}

.notification.success .notification-content {
    border-left-color: #52b788;
}

.notification.warning .notification-content {
    border-left-color: #ed8936;
}

.notification-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: #718096;
    margin-left: 1rem;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-muted {
    color: #718096;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .status-grid {
        grid-template-columns: 1fr;
    }

    .time-remaining {
        grid-template-columns: 1fr;
    }

    .verification-stats {
        grid-template-columns: 1fr;
    }

    .results-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .control-buttons {
        justify-content: center;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .footer-links {
        justify-content: center;
    }

    .transaction-item {
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
    }

    .notification {
        left: 20px;
        right: 20px;
        max-width: none;
    }
}