* {
    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: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

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

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

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

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 20px;
}

/* Main Content */
main {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}

/* Sections */
.upload-section, .retrieve-section {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.upload-section:hover, .retrieve-section:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 50px rgba(0,0,0,0.15);
}

.upload-section h2, .retrieve-section h2 {
    color: #667eea;
    margin-bottom: 25px;
    font-size: 1.5rem;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}

/* Upload Area */
.upload-area {
    margin-bottom: 20px;
}

.file-upload-area {
    margin-bottom: 25px;
}

.upload-zone {
    border: 3px dashed #ddd;
    border-radius: 15px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fafafa;
}

.upload-zone:hover, .upload-zone.dragover {
    border-color: #667eea;
    background: #f0f4ff;
    transform: scale(1.02);
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.7;
}

.upload-text {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 8px;
}

.upload-hint {
    font-size: 0.9rem;
    color: #999;
}

/* File List */
.file-list {
    margin-top: 20px;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 8px;
    border-left: 4px solid #667eea;
}

.file-info {
    display: flex;
    align-items: center;
    flex: 1;
}

.file-icon {
    margin-right: 10px;
    font-size: 1.2rem;
}

.file-details {
    flex: 1;
}

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

.file-size {
    font-size: 0.85rem;
    color: #666;
    margin-top: 2px;
}

.remove-file {
    background: #ff4757;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.2s ease;
}

.remove-file:hover {
    background: #ff3742;
}

/* Text Input */
.text-input-area {
    margin-bottom: 25px;
}

.text-input-area h3 {
    margin-bottom: 15px;
    color: #555;
    font-size: 1.1rem;
}

#textInput {
    width: 100%;
    min-height: 120px;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    transition: border-color 0.3s ease;
}

#textInput:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.char-counter {
    text-align: right;
    margin-top: 5px;
    font-size: 0.85rem;
    color: #666;
}

/* Buttons */
.upload-btn, .retrieve-btn, .copy-btn, .new-upload-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.upload-btn:hover, .retrieve-btn:hover, .copy-btn:hover, .new-upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.upload-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.upload-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* Loading Spinner */
.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
    display: none;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Progress Bar */
.progress-container {
    margin: 20px 0;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    text-align: center;
    margin-top: 10px;
    color: #666;
    font-size: 0.9rem;
}

/* Upload Result */
.result-container {
    background: #f8fff8;
    border: 2px solid #4caf50;
    border-radius: 15px;
    padding: 25px;
    margin-top: 20px;
}

.success-message h3 {
    color: #4caf50;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.verification-code {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: white;
    border-radius: 10px;
    border: 2px solid #e8f5e8;
}

.verification-code label {
    font-weight: 500;
    color: #333;
}

.code-display {
    font-family: 'Courier New', monospace;
    font-size: 1.8rem;
    font-weight: bold;
    color: #667eea;
    letter-spacing: 0.2em;
    background: #f0f4ff;
    padding: 8px 15px;
    border-radius: 8px;
    border: 2px solid #667eea;
}

.copy-btn {
    padding: 8px 15px;
    font-size: 0.9rem;
    min-width: auto;
}

.expiry-info {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.expiry-info p {
    color: #856404;
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.expiry-info p:last-child {
    margin-bottom: 0;
}

/* Retrieve Section */
.retrieve-area {
    margin-bottom: 20px;
}

.code-input-container {
    display: flex;
    gap: 15px;
    align-items: stretch;
}

#codeInput {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid #ddd;
    border-radius: 25px;
    font-size: 1.2rem;
    font-family: 'Courier New', monospace;
    text-align: center;
    letter-spacing: 0.3em;
    transition: border-color 0.3s ease;
}

#codeInput:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.retrieve-btn {
    padding: 15px 25px;
    white-space: nowrap;
}

.loading-container {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.loading-container .loading-spinner {
    display: inline-block;
    margin-bottom: 15px;
    width: 30px;
    height: 30px;
    border-width: 3px;
}

/* Content Display */
.content-container {
    background: #f8fff8;
    border: 2px solid #4caf50;
    border-radius: 15px;
    padding: 25px;
    margin-top: 20px;
}

.text-content, .file-content {
    margin-bottom: 20px;
}

.text-content h3, .file-content h3 {
    color: #4caf50;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.text-display {
    background: white;
    border: 1px solid #e8f5e8;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 300px;
    overflow-y: auto;
    font-family: inherit;
    line-height: 1.5;
}

.file-list-display {
    background: white;
    border: 1px solid #e8f5e8;
    border-radius: 10px;
    padding: 20px;
}

.download-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 10px;
    border-left: 4px solid #4caf50;
}

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

.download-info {
    display: flex;
    align-items: center;
    flex: 1;
}

.download-icon {
    margin-right: 12px;
    font-size: 1.3rem;
}

.download-details {
    flex: 1;
}

.download-name {
    font-weight: 500;
    color: #333;
    margin-bottom: 2px;
}

.download-size {
    font-size: 0.85rem;
    color: #666;
}

.download-btn {
    background: #4caf50;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.download-btn:hover {
    background: #45a049;
    transform: none;
    box-shadow: none;
}

.burn-notice {
    text-align: center;
    color: #ff6b6b;
    font-weight: 500;
    margin-top: 20px;
    padding: 10px;
    background: #ffe6e6;
    border-radius: 8px;
    border: 1px solid #ffcccc;
}

/* Messages */
.message-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    max-width: 400px;
}

.message {
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 10px;
    color: white;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateX(100%);
    animation: slideIn 0.3s ease forwards;
}

.message.success {
    background: #4caf50;
}

.message.error {
    background: #ff4757;
}

.message.info {
    background: #667eea;
}

@keyframes slideIn {
    to {
        transform: translateX(0);
    }
}

/* Footer */
footer {
    text-align: center;
    margin-top: 40px;
    color: rgba(255,255,255,0.8);
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    main {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    header h1 {
        font-size: 2.5rem;
    }
    
    .upload-section, .retrieve-section {
        padding: 20px;
    }
    
    .code-input-container {
        flex-direction: column;
    }
    
    .retrieve-btn {
        width: 100%;
    }
    
    .upload-zone {
        padding: 30px 15px;
    }
    
    .verification-code {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        gap: 10px;
    }
    
    .code-display {
        font-size: 1.5rem;
    }
    
    .message-container {
        left: 15px;
        right: 15px;
        max-width: none;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .upload-section, .retrieve-section {
        padding: 15px;
    }
    
    #textInput {
        min-height: 100px;
    }
    
    .file-item, .download-item {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        gap: 10px;
    }
    
    .file-info, .download-info {
        justify-content: center;
    }
}