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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f5f5f5;
    min-height: 100vh;
}

.container {
    max-width: 480px;
    margin: 0 auto;
    background-color: white;
    min-height: 100vh;
}

header {
    background-color: #2c3e50;
    color: white;
    padding: 20px;
    text-align: center;
}

header h1 {
    font-size: 24px;
    margin-bottom: 15px;
}

.tab-container {
    display: flex;
    justify-content: center;
    gap: 5px;
    flex-wrap: wrap;
    padding: 0 10px;
}

/* 2FA Styles */
.totp-card {
    background-color: #f0f8ff;
    border: 1px solid #2196F3;
    border-radius: 8px;
    margin-top: 10px;
}

.totp-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.totp-code-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.totp-code {
    font-size: 24px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    color: #2196F3;
    letter-spacing: 2px;
}

.totp-timer {
    font-size: 18px;
    font-weight: bold;
    color: #666;
    min-width: 30px;
    padding: 4px 8px;
    border-radius: 4px;
    background-color: rgba(33, 150, 243, 0.1);
}

.totp-timer.warning {
    color: #ff9800;
    background-color: rgba(255, 152, 0, 0.1);
}

.totp-timer.danger {
    color: #f44336;
    background-color: rgba(244, 67, 54, 0.1);
}

.progress-bar {
    width: 100%;
    height: 4px;
    background-color: #eee;
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #2196F3, #f44336);
    border-radius: 2px;
    transition: width 1s linear;
}

.tab-button {
    padding: 8px 20px;
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    border: 2px solid transparent;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
    flex: 0 1 auto;
    min-width: fit-content;
    white-space: nowrap;
}

.tab-button:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.tab-button.active {
    background-color: white;
    color: #2c3e50;
    border-color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transform: scale(1.05);
}

main {
    padding: 20px;
}

.info-section {
    margin-bottom: 30px;
}

.info-card {
    margin-bottom: 20px;
}

.info-card label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #34495e;
}

.input-group {
    display: flex;
    gap: 10px;
}

.input-group input {
    flex: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

.copy-btn {
    padding: 12px 20px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.copy-btn:hover {
    background-color: #2980b9;
}

.delete-btn {
    padding: 12px 20px;
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.delete-btn:hover {
    background-color: #c0392b;
}

.code-list {
    margin-bottom: 10px;
}

.code-item {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
}

.code-item input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
}

.update-btn {
    width: 100%;
    padding: 12px;
    background-color: #27ae60;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

.update-btn:hover {
    background-color: #229954;
}

.action-buttons {
    display: flex;
    gap: 10px;
    margin: 20px 0;
}

.used-btn {
    padding: 12px;
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

.used-btn:hover {
    background-color: #c0392b;
}

.used-btn.full-width {
    width: 100%;
    padding: 20px;
    font-size: 18px;
    font-weight: bold;
}

.next-btn {
    flex: 1;
    padding: 12px;
    background-color: #f39c12;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

.next-btn:hover {
    background-color: #e67e22;
}

.stats {
    text-align: center;
    padding: 15px;
    background-color: #ecf0f1;
    border-radius: 6px;
}

.stats strong {
    color: #27ae60;
    font-size: 20px;
}

.admin-section {
    border-top: 2px solid #ecf0f1;
    padding-top: 30px;
}

.admin-section h2 {
    margin-bottom: 20px;
    color: #2c3e50;
}

.admin-card {
    margin-bottom: 20px;
}

.admin-card label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
    color: #34495e;
}

.admin-card textarea {
    width: 100%;
    height: 120px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: monospace;
    resize: vertical;
}

.admin-stats {
    margin-top: 10px;
    padding: 10px;
    background-color: #ecf0f1;
    border-radius: 6px;
    text-align: center;
    font-size: 14px;
}

.admin-stats span {
    font-weight: bold;
    color: #2c3e50;
}

.code-input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.code-input-group input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

.code-input-group button {
    padding: 10px 20px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.code-edit-list {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 10px;
    padding-right: 5px;
}

.code-edit-item {
    display: flex;
    gap: 5px;
    margin-bottom: 8px;
    align-items: center;
}

.code-edit-item input {
    flex: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    min-width: 0;
}

.code-edit-item button {
    padding: 8px 12px;
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
}

.code-edit-item button.copy-btn {
    background-color: #3498db;
}

.code-edit-item button.copy-btn:hover {
    background-color: #2980b9;
}

.code-edit-item button.link-btn {
    padding: 8px 12px;
    background-color: #27ae60;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    white-space: nowrap;
    flex-shrink: 0;
}

.code-edit-item button.link-btn:hover {
    background-color: #229954;
}

/* TikTok theme link button */
.tiktok-theme .code-edit-item button.link-btn {
    background-color: #ff6b6b;
}

.tiktok-theme .code-edit-item button.link-btn:hover {
    background-color: #ee5a6f;
}

.button-row {
    display: flex;
    gap: 10px;
}

.button-row.bottom-buttons {
    margin: 30px 0 20px 0;
}

.view-used-btn, .view-available-btn {
    flex: 1;
    padding: 12px;
    background-color: #9b59b6;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

.view-used-btn:hover, .view-available-btn:hover {
    background-color: #8e44ad;
}

.view-available-btn {
    background-color: #3498db;
}

.view-available-btn:hover {
    background-color: #2980b9;
}

/* Popup styles */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.popup-content {
    background: white;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.popup-header h3 {
    margin: 0;
    color: #333;
}

.close-popup {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-popup:hover {
    color: #333;
}

.popup-body {
    padding: 20px;
    overflow-y: auto;
}

.copy-all-btn {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    margin-bottom: 15px;
    width: 100%;
}

.copy-all-btn:hover {
    background-color: #45a049;
}

#usedGmailList, #availableGmailList {
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
    white-space: pre-wrap;
    max-height: 400px;
    overflow-y: auto;
    color: #333;
}

.danger-zone {
    border: 2px solid #e74c3c;
    background-color: #fff5f5;
    margin-top: 30px;
}

.danger-zone label {
    color: #e74c3c;
    font-weight: bold;
}

.warning-text {
    color: #c0392b;
    font-size: 14px;
    margin: 10px 0;
}

.delete-all-btn {
    background-color: #e74c3c;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    width: 100%;
    transition: background-color 0.3s;
}

.delete-all-btn:hover {
    background-color: #c0392b;
}

/* Gmail overlay styles */
.gmail-overlay {
    position: relative;
    background-color: rgba(240, 240, 240, 0.95);
    padding: 40px 20px;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 20px;
    backdrop-filter: blur(5px);
}

.get-gmail-btn {
    background-color: #27ae60;
    color: white;
    padding: 15px 40px;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.get-gmail-btn:hover {
    background-color: #229954;
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}

.get-gmail-btn:active {
    transform: translateY(0);
}

.gmail-content {
    animation: fadeIn 0.3s ease-in;
}

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

/* Phone verification styles */
.get-phone-btn {
    background-color: #3498db;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    width: 100%;
    transition: background-color 0.3s;
    margin-bottom: 15px;
}

.get-phone-btn:hover {
    background-color: #2980b9;
}

.get-phone-btn:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
}

.get-new-phone-btn {
    background-color: #e74c3c;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    width: 100%;
    transition: background-color 0.3s;
    margin-bottom: 15px;
}

.get-new-phone-btn:hover {
    background-color: #c0392b;
}

.get-new-phone-btn:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
}

#phoneResult {
    margin-top: 15px;
}

.waiting-text {
    color: #3498db;
    font-size: 14px;
    margin-bottom: 10px;
    text-align: center;
}

.loader {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 10px auto;
}

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

#codeWaiting {
    margin: 15px 0;
}

#codeResult {
    margin-top: 15px;
}

#codeResult label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #2c3e50;
}

/* Tab Theme Styles */
.container {
    transition: all 0.3s ease;
}

/* SHEIN Theme */
.shein-theme .copy-btn,
.shein-theme .code-input-group button,
.shein-theme .view-available-btn {
    background-color: #3498db;
}

.shein-theme .copy-btn:hover,
.shein-theme .code-input-group button:hover,
.shein-theme .view-available-btn:hover {
    background-color: #2980b9;
}

/* TEMU Theme */
.temu-theme .copy-btn,
.temu-theme .code-input-group button,
.temu-theme .view-available-btn {
    background-color: #f39c12;
}

.temu-theme .copy-btn:hover,
.temu-theme .code-input-group button:hover,
.temu-theme .view-available-btn:hover {
    background-color: #e67e22;
}

.temu-theme .get-gmail-btn {
    background-color: #d68910;
}

.temu-theme .get-gmail-btn:hover {
    background-color: #ca6f1e;
}

/* TikTok Theme */
.tiktok-theme .copy-btn,
.tiktok-theme .code-input-group button,
.tiktok-theme .view-available-btn {
    background-color: #e74c3c;
}

.tiktok-theme .copy-btn:hover,
.tiktok-theme .code-input-group button:hover,
.tiktok-theme .view-available-btn:hover {
    background-color: #c0392b;
}

.tiktok-theme .get-gmail-btn {
    background-color: #cb4335;
}

.tiktok-theme .get-gmail-btn:hover {
    background-color: #a93226;
}

.tiktok-theme .get-phone-btn {
    background-color: #ec7063;
}

.tiktok-theme .get-phone-btn:hover {
    background-color: #e74c3c;
}

/* Address Theme */
.address-theme .copy-btn,
.address-theme .code-input-group button {
    background-color: #16a085;
}

.address-theme .copy-btn:hover,
.address-theme .code-input-group button:hover {
    background-color: #138d75;
}

/* Address Section Styles */
.address-section {
    display: none;
}

.address-buttons {
    display: flex;
    flex-wrap: nowrap;
    gap: 5px;
    margin: 15px 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.address-btn {
    flex: 0 0 auto;
    min-width: 50px;
    padding: 10px 12px;
    background-color: #ecf0f1;
    border: 2px solid #bdc3c7;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
    white-space: nowrap;
}

.address-btn:hover {
    background-color: #d5dbdb;
}

.address-btn.active {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
}

.address-form {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
}

.address-field {
    margin-bottom: 15px;
}

.address-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #34495e;
}

.address-field .input-group {
    display: flex;
    gap: 5px;
    align-items: center;
}

.address-field input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    min-width: 0;
}

.save-btn {
    padding: 10px 12px;
    background-color: #27ae60;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    white-space: nowrap;
    transition: background-color 0.3s;
    flex: 0 0 auto;
    min-width: 45px;
}

.save-btn:hover {
    background-color: #229954;
}

.save-btn:active {
    transform: scale(0.95);
}

@media (max-width: 480px) {
    .container {
        max-width: 100%;
    }
    
    header {
        padding: 15px 10px;
    }
    
    header h1 {
        font-size: 20px;
        margin-bottom: 12px;
    }
    
    .tab-container {
        gap: 3px;
        padding: 0 5px;
    }
    
    .tab-button {
        padding: 6px 10px;
        font-size: 11px;
        flex: 0 1 auto;
        min-width: fit-content;
    }
    
    .tab-button.active {
        transform: scale(1.02);
    }
    
    main {
        padding: 15px;
    }
    
    /* Address section mobile optimization */
    .address-form {
        padding: 15px;
    }
    
    .address-field {
        margin-bottom: 12px;
    }
    
    .address-field label {
        font-size: 13px;
        margin-bottom: 5px;
    }
    
    .address-field input {
        font-size: 13px;
        padding: 8px;
    }
    
    .copy-btn {
        padding: 8px 12px;
        font-size: 12px;
        min-width: 50px;
    }
    
    .save-btn {
        padding: 8px 10px;
        font-size: 12px;
        min-width: 40px;
    }
    
    /* Mobile code edit items */
    .code-edit-item {
        gap: 3px;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .code-edit-item input {
        flex: 1 1 auto;
        min-width: 100px;
    }
    
    .code-edit-item button {
        flex: 0 0 auto;
        padding: 6px 8px;
        font-size: 11px;
    }
    
    .code-edit-item button.link-btn {
        padding: 6px 8px;
        font-size: 11px;
    }
    
    .address-buttons {
        margin: 10px 0;
    }
    
    .address-btn {
        padding: 8px 10px;
        font-size: 13px;
        min-width: 45px;
    }
}

/* Address 3 Settings */
.address3-settings textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    resize: vertical;
}

.address3-stats {
    margin-top: 10px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 6px;
    font-size: 14px;
    color: #666;
}

.address3-stats span {
    font-weight: bold;
    color: #2c3e50;
}