* {
    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: 20px;
}

.auth-container {
    width: 100%;
    max-width: 400px;
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
}

.auth-container.hidden {
    display: none;
}

.logo {
    font-size: 32px;
    margin-bottom: 10px;
}

.auth-container h1 {
    color: #333;
    margin-bottom: 10px;
    font-size: 28px;
}

.auth-container p {
    color: #666;
    margin-bottom: 30px;
    font-size: 14px;
}

.auth-input-group {
    margin-bottom: 20px;
}

.auth-input-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.auth-input-group input:focus {
    outline: none;
    border-color: #667eea;
}

.auth-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.auth-btn:hover {
    transform: translateY(-2px);
}

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

.auth-error {
    color: #e74c3c;
    font-size: 14px;
    margin-bottom: 20px;
    display: none;
}

.home-container {
    width: 100%;
    max-width: 1200px;
}

.home-container.hidden {
    display: none;
}

.header {
    background: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.header h1 {
    color: #333;
    font-size: 24px;
}

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

.logout-btn:hover {
    background: #c0392b;
}

.tiles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.tile {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}

.tile:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
}

.tile-icon {
    font-size: 40px;
    margin-bottom: 15px;
}

.tile h2 {
    color: #333;
    margin-bottom: 10px;
    font-size: 20px;
}

.tile p {
    color: #666;
    font-size: 14px;
}

.content-area {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    display: none;
}

.content-area.active {
    display: block;
    animation: slideIn 0.3s ease-out;
}

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

.back-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    margin-bottom: 20px;
    font-size: 14px;
}

.back-btn:hover {
    background: #5568d3;
}

/* Text Sharing */
.text-input {
    width: 100%;
    height: 200px;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    resize: vertical;
    margin-bottom: 15px;
}

.button-group {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-secondary {
    background: #ecf0f1;
    color: #333;
}

.btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

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

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.snippets-list {
    display: grid;
    gap: 10px;
}

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

.snippet-content {
    flex: 1;
    margin-right: 15px;
}

.snippet-content p {
    color: #333;
    word-break: break-all;
    max-height: 50px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.snippet-time {
    font-size: 12px;
    color: #999;
    margin-bottom: 5px;
}

.snippet-actions {
    display: flex;
    gap: 8px;
    white-space: nowrap;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
    background: #e0e0e0;
    color: #333;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-small:hover {
    background: #d0d0d0;
}

.btn-small.danger {
    background: #e74c3c;
    color: white;
}

.btn-small.danger:hover {
    background: #c0392b;
}

/* File Sharing */
.file-upload-area {
    border: 2px dashed #667eea;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    margin-bottom: 20px;
    transition: background 0.2s;
    cursor: pointer;
}

.file-upload-area:hover {
    background: #f0f4ff;
}

.file-upload-area.dragover {
    background: #f0f4ff;
    border-color: #764ba2;
}

.file-upload-area p {
    color: #666;
    margin-bottom: 10px;
}

.file-upload-area small {
    color: #999;
    display: block;
}

.file-list {
    display: grid;
    gap: 12px;
}

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

.file-info {
    flex: 1;
}

.file-name {
    color: #333;
    font-weight: 600;
    margin-bottom: 5px;
    word-break: break-all;
}

.file-meta {
    font-size: 12px;
    color: #999;
}

.file-actions {
    display: flex;
    gap: 8px;
    white-space: nowrap;
}

.loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

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

.status-message {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: none;
}

.status-message.show {
    display: block;
}

.status-message.success {
    background: #d5f4e6;
    color: #27ae60;
    border-left: 4px solid #27ae60;
}

.status-message.error {
    background: #fadbd8;
    color: #e74c3c;
    border-left: 4px solid #e74c3c;
}

.status-message.info {
    background: #d6eaf8;
    color: #2980b9;
    border-left: 4px solid #2980b9;
}

.hidden-file-input {
    display: none;
}

.qr-display {
    text-align: center;
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.qr-display canvas {
    max-width: 300px;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    pointer-events: none;
}

.toast {
    min-width: 300px;
    max-width: 500px;
    padding: 14px 16px;
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    pointer-events: all;
    animation: slideOut 0.3s ease-out;
    opacity: 0;
}

.toast.show {
    opacity: 1;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

.toast-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffe8a8 100%);
    color: #856404;
    border-left: 4px solid #ffc107;
}

.toast-success {
    background: linear-gradient(135deg, #d5f4e6 0%, #b8e8d5 100%);
    color: #27ae60;
    border-left: 4px solid #27ae60;
}

.toast-error {
    background: linear-gradient(135deg, #fadbd8 0%, #f5b7b1 100%);
    color: #e74c3c;
    border-left: 4px solid #e74c3c;
}

@media (max-width: 600px) {
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
    }

    .toast {
        min-width: auto;
        max-width: none;
    }
}

/* Password Generator UI */
.password-config-panel {
    background: white;
    border: 1px solid #e0e0e0;
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.char-option {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 16px;
    padding: 14px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 12px;
    align-items: center;
}

.char-option:last-of-type {
    margin-bottom: 0;
}

.char-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #667eea;
}

.char-option label {
    color: #333;
    font-weight: 500;
    font-size: 14px;
}

.char-min {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.char-min label {
    color: #666;
    font-size: 13px;
    font-weight: 500;
    margin: 0;
}

.char-min input {
    width: 60px;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    text-align: center;
}

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

#passphraseOptions {
    display: flex !important;
    align-items: center;
    gap: 8px;
    grid-column: 1 / -1;
}

#passphraseOptions label {
    color: #666;
    font-size: 13px;
    font-weight: 500;
    margin: 0;
}

#passphraseOptions select {
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    background: white;
    cursor: pointer;
}

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

.length-config {
    display: flex;
    gap: 16px;
    align-items: flex-end;
}

.length-config input[type="number"] {
    width: 80px;
    padding: 10px 12px;
    border: 2px solid #667eea;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
}

.length-config input[type="number"]:focus {
    outline: none;
    border-color: #764ba2;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

@media (max-width: 600px) {
    .tiles-grid {
        grid-template-columns: 1fr;
    }

    .header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .button-group {
        flex-direction: column;
    }

    .char-option {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .char-min {
        justify-content: space-between;
    }

    .length-config {
        flex-direction: column;
        align-items: stretch;
    }

    .length-config input[type="number"] {
        width: 100%;
    }

    .btn.btn-secondary {
        width: 100%;
    }
}
