/* 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: #333;
    background: #003b5c;
    min-height: 100vh;
}

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

/* Header */
header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
    position: relative;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Auth status */
.auth-status {
    position: absolute;
    top: 20px;
    right: 20px;
    color: white;
    display: flex;
    align-items: center;
    gap: 15px;
}

#username-display {
    font-weight: 600;
}

#logout-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 6px 12px;
    font-size: 12px;
    text-transform: none;
    letter-spacing: normal;
}

#logout-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: none;
}

/* Navigation tabs */
.tabs {
    display: flex;
    justify-content: center;
    gap: 0;
    margin-bottom: 30px;
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 5px;
    backdrop-filter: blur(10px);
}

.tab-btn {
    padding: 12px 24px;
    border: none;
    background: transparent;
    color: white;
    cursor: pointer;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
    flex: 1;
    max-width: 200px;
}

.tab-btn:hover {
    background: rgba(255,255,255,0.1);
}

.tab-btn.active {
    background: white;
    color: #003b5c;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Tab content */
.tab-content {
    display: none;
}

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

/* Cards */
.card {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

/* Auth forms */
.auth-tabs {
    display: flex;
    justify-content: center;
    gap: 0;
    margin-bottom: 30px;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 4px;
}

.auth-tab-btn {
    padding: 10px 20px;
    border: none;
    background: transparent;
    color: #6c757d;
    cursor: pointer;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
    flex: 1;
}

.auth-tab-btn:hover {
    background: rgba(120, 190, 67, 0.1);
    color: #78be43;
    transform: none;
}

.auth-tab-btn.active {
    background: #78be43;
    color: white;
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.card-header {
    display: flex;
    justify-content: between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.card-header h2 {
    color: #333;
    font-size: 1.8rem;
    flex: 1;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #555;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e1e1;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: #78be43;
    box-shadow: 0 0 0 3px rgba(120, 190, 67, 0.1);
}

/* Buttons */
button {
    background: #78be43;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

button:hover {
    background: #6ba839;
    transform: translateY(-2px);
}

button:active {
    transform: translateY(0);
}

.refresh-btn {
    background: #003b5c;
    padding: 8px 16px;
    font-size: 14px;
    text-transform: none;
    letter-spacing: normal;
}

.refresh-btn:hover {
    background: #002a42;
    box-shadow: 0 3px 10px rgba(0, 59, 92, 0.4);
}

.view-btn {
    background: #003b5c;
    padding: 6px 12px;
    font-size: 12px;
    text-transform: none;
    letter-spacing: normal;
}

.view-btn:hover {
    background: #002a42;
    box-shadow: 0 2px 8px rgba(0, 59, 92, 0.4);
}

/* Result messages */
.result-message {
    margin-top: 15px;
    padding: 12px 15px;
    border-radius: 8px;
    font-weight: 500;
}

.result-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.result-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.result-message.loading {
    background: #e2e3e5;
    color: #6c757d;
    border: 1px solid #d6d8db;
}

/* Loading states */
.loading {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
    font-style: italic;
}

/* Empty states */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
    font-style: italic;
}

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.data-table th,
.data-table td {
    padding: 15px 12px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.data-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.data-table tr:hover {
    background: #f8f9fa;
}

.data-table tr:last-child td {
    border-bottom: none;
}

/* Status badges */
.status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status.active {
    background: #d4edda;
    color: #155724;
}

.status.expired {
    background: #fff3cd;
    color: #856404;
}

.status.completed {
    background: #cce7ff;
    color: #0056b3;
}

/* Links */
.tweet-link {
    color: #1da1f2;
    text-decoration: none;
    font-weight: 500;
}

.tweet-link:hover {
    text-decoration: underline;
}

/* Address and TX hash styling */
.address, .tx-hash {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    background: #f8f9fa;
    padding: 4px 8px;
    border-radius: 4px;
}

.tx-hash span {
    cursor: help;
}

/* Error states */
.error {
    color: #dc3545;
    text-align: center;
    padding: 20px;
    background: #f8d7da;
    border-radius: 8px;
    border: 1px solid #f5c6cb;
}

/* Wallet styles */
.wallet-info {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.wallet-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #e9ecef;
}

.wallet-section h3 {
    margin-bottom: 10px;
    color: #495057;
    font-size: 1.2rem;
}

.wallet-description {
    color: #6c757d;
    margin-bottom: 15px;
    font-size: 14px;
}

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

.address-input, .pubkey-input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e1e1e1;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    background: white;
    color: #495057;
}

.copy-btn {
    background: #003b5c;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    text-transform: none;
    letter-spacing: normal;
    min-width: 80px;
}

.copy-btn:hover {
    background: #002a42;
    transform: none;
}

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

.balance-amount {
    font-size: 2rem;
    font-weight: 700;
    color: #78be43;
}

.balance-currency {
    font-size: 1.2rem;
    color: #6c757d;
    font-weight: 500;
}

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

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    header h1 {
        font-size: 2rem;
    }

    .tabs {
        flex-direction: column;
        gap: 5px;
    }

    .tab-btn {
        max-width: none;
    }

    .card {
        padding: 20px;
    }

    .card-header {
        flex-direction: column;
        align-items: stretch;
    }

    .data-table {
        font-size: 14px;
    }

    .data-table th,
    .data-table td {
        padding: 10px 8px;
    }

    /* Stack table on mobile */
    .data-table thead {
        display: none;
    }

    .data-table tr {
        display: block;
        margin-bottom: 15px;
        background: white;
        border: 1px solid #dee2e6;
        border-radius: 8px;
        padding: 15px;
    }

    .data-table td {
        display: block;
        padding: 5px 0;
        border: none;
        text-align: left;
    }

    .data-table td:before {
        content: attr(data-label) ": ";
        font-weight: bold;
        color: #495057;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.tab-content.active {
    animation: fadeIn 0.3s ease;
}

.wallet-info {
    margin-bottom: 2em;
}

/* Global View Styles */
.global-view-container {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.global-post-item {
    border: 1px solid #e9ecef;
    border-radius: 12px;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.global-post-item:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.post-header {
    padding: 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.post-info {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.post-info span {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.post-type {
    background: #e9ecef;
    color: #495057;
}

.reward-amount {
    background: #d4edda;
    color: #155724;
}

.max-winners {
    background: #cce7ff;
    color: #0056b3;
}

.min-followers {
    background: #fff3cd;
    color: #856404;
}

.post-times {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: #6c757d;
    flex-wrap: wrap;
    gap: 15px;
}

.tweet-embed-container {
    padding: 20px;
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tweet-loading {
    color: #6c757d;
    font-style: italic;
    text-align: center;
}

.tweet-fallback {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.fallback-link {
    color: #1da1f2;
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    padding: 12px 24px;
    background: white;
    border-radius: 8px;
    border: 2px solid #1da1f2;
    transition: all 0.3s ease;
}

.fallback-link:hover {
    background: #1da1f2;
    color: white;
    transform: translateY(-2px);
}

.fallback-note {
    margin-top: 10px;
    font-size: 12px;
    color: #6c757d;
    font-style: italic;
}

/* Twitter embed styling overrides */
.tweet-embed-container .twitter-tweet {
    margin: 0 auto !important;
}

/* Responsive adjustments for global view */
@media (max-width: 768px) {
    .post-info {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .post-info span {
        text-align: center;
    }
    
    .post-times {
        flex-direction: column;
        gap: 8px;
    }
    
    .tweet-embed-container {
        padding: 15px;
    }
}
