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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #ffffff;
    color: #000000;
    line-height: 1.6;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    text-align: center;
    margin-bottom: 40px;
    padding: 20px 0;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: #000000;
}

.header p {
    font-size: 1.1rem;
    color: #666666;
}

.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.card {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.card h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: #000000;
}

.form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 500;
    color: #000000;
    font-size: 0.95rem;
}

.form-group input {
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

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

.btn {
    background-color: #000000;
    color: #ffffff;
    border: none;
    padding: 14px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease;
    text-align: center;
    text-decoration: none;
    display: inline-block;
}

.btn:hover {
    background-color: #333333;
}

.btn:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

.hidden {
    display: none !important;
}

.loading {
    text-align: center;
    padding: 40px 20px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #000000;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.analysis-content {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
    white-space: pre-line;
    line-height: 1.8;
}

.search-results {
    margin-top: 20px;
}

.letter-item {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 4px solid #000000;
}

.letter-item h3 {
    margin-bottom: 10px;
    color: #000000;
}

.letter-date {
    font-size: 0.9rem;
    color: #666666;
    margin-bottom: 15px;
}

.footer {
    text-align: center;
    padding: 30px 0;
    margin-top: 40px;
    color: #666666;
    font-size: 0.9rem;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .card {
        padding: 20px;
    }
    
    .btn {
        padding: 12px 20px;
        font-size: 0.95rem;
    }
    
    .form-group input {
        padding: 10px 14px;
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.8rem;
    }
    
    .card {
        padding: 15px;
    }
    
    .btn {
        padding: 10px 16px;
        font-size: 0.9rem;
    }
}

/* Success and Error Messages */
.message {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 10px 0;
    font-weight: 500;
}

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

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

.message.info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* File input styles */
.file-input-container {
    position: relative;
    display: inline-block;
    width: 100%;
}

.file-input-container input[type="file"] {
    position: absolute;
    left: -9999px;
    opacity: 0;
    cursor: pointer;
}

.file-input-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    background: #000000;
    color: white;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    font-weight: 600;
    font-size: 1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.file-input-label:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    background: #333333;
}

.file-input-label:active {
    transform: translateY(0);
}

.file-icon {
    font-size: 1.2rem;
}

.file-icon i {
    font-size: 1.2rem;
}

.file-text {
    font-weight: 600;
}

.file-list {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.file-item .file-name {
    font-weight: 500;
    color: #333;
    flex: 1;
}

.file-item .file-size {
    color: #6c757d;
    font-size: 0.9rem;
}

.file-item .remove-file {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    font-size: 0.8rem;
    transition: background-color 0.3s ease;
}

.file-item .remove-file:hover {
    background: #c82333;
}

.file-info {
    margin-top: 0.5rem;
    color: #6c757d;
    font-size: 0.9rem;
    font-style: italic;
}

/* Sticky search icon */
.sticky-search {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.sticky-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: #000000;
    color: white;
    border-radius: 50%;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.sticky-icon:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    background: #333333;
}

.sticky-icon i {
    font-size: 1.2rem;
}

/* Letter item styles */
.letter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.status {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status.success {
    background-color: #d4edda;
    color: #155724;
}

.status.warning {
    background-color: #fff3cd;
    color: #856404;
}

.payment-required {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #ffc107;
    margin-top: 10px;
}

.payment-required p {
    margin-bottom: 10px;
    color: #856404;
}

.action-buttons {
    margin-top: 15px;
    display: flex;
    gap: 10px;
}

.view-btn {
    background: #17a2b8;
    color: white;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: background-color 0.3s ease;
}

.view-btn:hover {
    background: #138496;
    color: white;
    text-decoration: none;
}

/* Email input visibility */
.form-group.email-group {
    display: none;
}

.form-group.email-group.visible {
    display: flex;
}

/* Analysis page styles */
.analysis-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

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

.analysis-date {
    color: #6c757d;
    font-size: 0.9rem;
}

.analysis-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.original-text-section,
.ai-analysis-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #007bff;
}

.ai-analysis-section {
    border-left-color: #28a745;
}

.text-content,
.analysis-text {
    white-space: pre-line;
    line-height: 1.6;
    color: #333;
    max-height: 400px;
    overflow-y: auto;
    padding: 15px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.share-options {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.share-btn,
.copy-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
}

.share-btn {
    background: #007bff;
}

.copy-btn {
    background: #6c757d;
}

.share-btn:hover {
    background: #0056b3;
}

.copy-btn:hover {
    background: #545b62;
}

/* Message styles */
.message {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-weight: 500;
}

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

.message.info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Header with logo */
.header-content {
    display: flex;
    align-items: center;
    gap: 15px;
    justify-content: center;
}

.logo {
    width: 50px;
    height: 50px;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

.logo:hover {
    transform: scale(1.05);
}

.logo-text {
    width: 50px;
    height: 50px;
    background: #000000;
    color: #ffffff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

.logo-text:hover {
    transform: scale(1.05);
}

.header-text {
    text-align: center;
}

/* Footer with stats */
.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.stats {
    font-size: 0.8rem;
    color: #6c757d;
    font-style: italic;
}

/* Analysis preview styles */
.analysis-preview {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.analysis-preview h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 1.1rem;
}

.preview-content {
    position: relative;
    max-height: 100px;
    overflow: hidden;
    background: white;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    white-space: pre-line;
    line-height: 1.6;
}

.preview-fade {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30px;
    background: linear-gradient(transparent, #f8f9fa);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    font-weight: bold;
    color: #666;
}

/* Multiple sticky icons */
.sticky-search {
    display: flex;
    flex-direction: column;
    gap: 10px;
} 