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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

header {
    background: #1da1f2;
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-bottom: 2rem;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

header h1 a {
    color: white;
    text-decoration: none;
    transition: opacity 0.2s;
}

header h1 a:hover {
    opacity: 0.8;
}

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

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1rem;
}

.input-section {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.input-section h2 {
    margin-bottom: 1rem;
    color: #333;
}

#tweetForm, #videoForm {
    display: flex;
    gap: 1rem;
    align-items: center;
}

#tweetInput {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

#tweetInput:focus {
    outline: none;
    border-color: #1da1f2;
}

button {
    padding: 0.75rem 1.5rem;
    background: #1da1f2;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.2s;
}

button:hover {
    background: #0d8bd9;
}

button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.loading, .results, .error {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.hidden {
    display: none;
}

.loading {
    text-align: center;
    color: #666;
}

.error {
    background: #fff5f5;
    border: 1px solid #fed7d7;
    color: #c53030;
}

.result-item {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.result-item:last-child {
    margin-bottom: 0;
}

.result-content {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.image-container {
    flex: 0 0 300px;
}

.text-container {
    flex: 1;
}

.image-preview {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.ocr-text {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 4px;
    margin: 1rem 0;
    white-space: pre-wrap;
    font-family: monospace;
    border-left: 4px solid #1da1f2;
}

.search-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.search-links a, .bulk-search-buttons button {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: #f8f9fa;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    border: 1px solid #ddd;
    transition: background-color 0.2s;
    cursor: pointer;
    font-size: 0.9rem;
}

.search-links a:hover, .bulk-search-buttons button:hover {
    background: #e9ecef;
}

.bulk-search-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #eee;
}

.bulk-search-buttons button {
    background: #1da1f2;
    color: white;
    border: 1px solid #1da1f2;
}

.bulk-search-buttons button:hover {
    background: #0d8bd9;
    border-color: #0d8bd9;
}

.bulk-search-buttons button.lucky {
    background: #34d399;
    border-color: #34d399;
}

.bulk-search-buttons button.lucky:hover {
    background: #10b981;
    border-color: #10b981;
}

/* Individual search button styles */
.tinyeye-btn {
    background: #e74c3c !important;
    border-color: #e74c3c !important;
    color: white !important;
}

.tinyeye-btn:hover {
    background: #c0392b !important;
    border-color: #c0392b !important;
}

.google-lens-btn {
    background: #4285f4 !important;
    border-color: #4285f4 !important;
    color: white !important;
}

.google-lens-btn:hover {
    background: #3367d6 !important;
    border-color: #3367d6 !important;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.tool-card {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.tool-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.tool-card h2 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.tool-card p {
    color: #666;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.tool-link {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: #1da1f2;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    transition: background-color 0.2s;
}

.tool-link:hover {
    background: #0d8bd9;
}

/* Video downloader specific styles */
.video-item {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.video-item:last-child {
    margin-bottom: 0;
}

.video-info h3 {
    margin: 0 0 0.5rem 0;
    color: #333;
}

.video-details {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.video-details span {
    background: #f8f9fa;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #666;
}

.quality {
    background: #e3f2fd !important;
    color: #1976d2 !important;
}

.resolution {
    background: #f3e5f5 !important;
    color: #7b1fa2 !important;
}

.video-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.download-link, .copy-link {
    padding: 0.5rem 1rem;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
}

.download-link {
    background: #4caf50;
    color: white;
}

.download-link:hover {
    background: #45a049;
}

.copy-link {
    background: #f8f9fa;
    color: #333;
    border: 1px solid #ddd;
}

.copy-link:hover {
    background: #e9ecef;
}

/* Login form styles */
.login-section {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
    max-width: 400px;
    margin: 0 auto 2rem auto;
}

.login-section h2 {
    margin-bottom: 1.5rem;
    color: #333;
    text-align: center;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #333;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: #1da1f2;
}

#loginForm button {
    width: 100%;
    padding: 0.875rem;
    background: #1da1f2;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: background-color 0.2s;
    margin-top: 0.5rem;
}

#loginForm button:hover {
    background: #0d8bd9;
}

#loginForm button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

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

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

footer {
    text-align: center;
    padding: 2rem 0;
    color: #666;
    border-top: 1px solid #ddd;
    margin-top: 3rem;
}

/* Prevent login form flash */
body:not(.auth-initialized) #loginSection,
body:not(.auth-initialized) #mainContent {
    visibility: hidden;
}

/* Tweet link button styling - uses same styling as other buttons */

/* API Response Viewer styles */
.api-response-container {
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

.jsoncrack-widget {
    border-top: 1px solid #ddd;
    background: white;
}

.jsoncrack-widget iframe {
    border: none;
    width: 100%;
    min-height: 600px;
}


.response-actions {
    background: #e9ecef;
    padding: 1rem;
    border-bottom: 1px solid #ddd;
    display: flex;
    gap: 1rem;
}

.copy-btn {
    padding: 0.5rem 1rem;
    background: #1da1f2;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.2s;
}

.copy-btn:hover {
    background: #0d8bd9;
}

.json-response {
    background: #fff;
    color: #333;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.85rem;
    line-height: 1.4;
    padding: 1.5rem;
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    border: none;
}

@media (max-width: 600px) {
    #tweetForm, #videoForm {
        flex-direction: column;
    }
    
    .search-links {
        flex-direction: column;
    }
    
    .result-content {
        flex-direction: column;
    }
    
    .image-container {
        flex: none;
    }
    
    .response-actions {
        flex-direction: column;
    }
    
    .json-response {
        font-size: 0.75rem;
    }
}

