/* 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;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    color: #333;
}

.container {
    width: 100%;
    max-width: 28rem;
}

/* Message box for mediamat.eu */
.message-box {
    background: white;
    border-radius: 1rem;
    padding: 2.5rem 1.5rem;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.message-box h1 {
    font-size: 2rem;
    color: #667eea;
    margin-bottom: 1rem;
}

.message-box p {
    font-size: 1.125rem;
    color: #666;
}

/* Form box for mmat.app */
.form-box {
    background: white;
    border-radius: 1rem;
    padding: 2.5rem 1.5rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.form-box h1 {
    font-size: 1.875rem;
    color: #667eea;
    margin-bottom: 2rem;
    text-align: center;
}

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

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #555;
    margin-bottom: 0.5rem;
}

.form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    outline: none;
}

.form-group input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

button {
    width: 100%;
    padding: 0.875rem;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

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

/* Upload page specific styles */
.subtitle {
    margin-bottom: 1.5rem;
    text-align: center;
}

.pwa-installed-hint {
    margin-bottom: 1rem;
    padding: 10px;
    background: #e8f5e9;
    border: 1px solid #4CAF50;
    border-radius: 8px;
    font-size: 0.875rem;
    color: #2e7d32;
}

.share-info {
    margin-top: 1rem;
    padding: 12px;
    background: #e7f3ff;
    border: 1px solid #2196F3;
    border-radius: 8px;
}

.share-info-title {
    margin: 0 0 8px 0;
    font-weight: 500;
    color: #0d47a1;
}

.pwa-install-button {
    margin-bottom: 12px;
    padding: 10px 16px;
    background: #4CAF50;
    border: none;
    border-radius: 6px;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    font-size: 0.95rem;
}

.share-info-text {
    margin: 0 0 8px 0;
    font-size: 0.9rem;
    color: #1565c0;
}

.install-steps {
    margin: 0;
    padding-left: 20px;
    font-size: 0.85rem;
    color: #1565c0;
}

.ios-heic-note {
    margin: 8px 0 0 0;
    font-size: 0.85rem;
    color: #1565c0;
    font-style: italic;
}

.files-summary-btn {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
    text-align: left;
    font-size: 1rem;
    color: #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.files-list-container {
    margin-top: 8px;
    padding: 12px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    border-bottom: 1px solid #dee2e6;
    font-size: 0.9rem;
}

.file-info {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-weight: 500;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.btn-remove {
    background: #dc3545;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    margin-left: 10px;
    flex-shrink: 0;
    white-space: nowrap;
}

.btn-remove:hover {
    background: #c82333;
}

.upload-progress {
    margin-bottom: 15px;
    font-size: 0.85rem;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.progress-filename {
    font-weight: 500;
    color: #333;
}

.progress-speed {
    color: #666;
    font-size: 0.8rem;
}

.progress-bar-container {
    width: 100%;
    height: 20px;
    background: #eee;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #28a745, #20c997);
    transition: width 0.1s;
}

.progress-percent {
    position: absolute;
    top: 2px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.progress-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 4px;
    font-size: 0.75rem;
    color: #666;
}

.progress-error {
    margin-top: 6px;
    padding: 8px;
    background: #fee;
    border: 1px solid #dc3545;
    border-radius: 4px;
    color: #dc3545;
    font-size: 0.8rem;
    font-weight: 500;
}

.upload-complete {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #e8f5e9;
    border: 1px solid #4CAF50;
    border-radius: 8px;
    text-align: center;
}

.upload-complete-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2e7d32;
    margin-bottom: 1rem;
}

.upload-complete-actions {
    display: flex;
    gap: 10px;
}

.footer-help {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
    font-size: 0.875rem;
    color: #888;
}

.footer-help a {
    color: #007bff;
    text-decoration: none;
}

.footer-help a:hover {
    text-decoration: underline;
}

/* Terms Modal */
.terms-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.terms-modal {
    background: white;
    border-radius: 1rem;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.terms-modal-content {
    padding: 2rem;
    position: relative;
}

.terms-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 2rem;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s ease;
}

.terms-modal-close:hover {
    color: #333;
}

.terms-modal h2 {
    font-size: 1.5rem;
    color: #667eea;
    margin-bottom: 1rem;
}

.terms-modal h3 {
    font-size: 1.25rem;
    color: #667eea;
    margin-bottom: 1rem;
}

.terms-modal h4 {
    font-size: 1.1rem;
    color: #333;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.terms-modal p {
    margin-bottom: 1rem;
    line-height: 1.6;
    color: #555;
}

.terms-modal ul {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.terms-modal li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
    color: #555;
}

.terms-modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.btn-accept {
    flex: 1;
    padding: 0.875rem;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-accept:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

.btn-decline {
    flex: 1;
    padding: 0.875rem;
    font-size: 1rem;
    font-weight: 600;
    color: #dc3545;
    background: white;
    border: 2px solid #dc3545;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-decline:hover {
    background: #dc3545;
    color: white;
    transform: translateY(-2px);
}

/* Tablet and larger */
@media (min-width: 640px) {
    .message-box,
    .form-box {
        padding: 3rem 2rem;
    }

    .message-box h1 {
        font-size: 2.5rem;
    }

    .form-box h1 {
        font-size: 2.25rem;
    }

    .terms-modal-content {
        padding: 2.5rem;
    }
}
