/* Component-specific styles */

/* Content items */
.content-item {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: box-shadow 0.2s ease;
}

.content-item:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.content-text {
    font-size: 16px;
    line-height: 1.5;
    word-break: break-word;
    white-space: pre-wrap;
    max-height: 200px;
    overflow-y: auto;
}

.content-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #6c757d;
    border-top: 1px solid #eee;
    padding-top: 0.5rem;
}

.content-time {
    font-weight: 500;
}

.content-device {
    font-style: italic;
}

.copy-btn {
    align-self: flex-end;
    background: #28a745;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.2s ease;
}

.copy-btn:hover {
    background: #218838;
}

.copy-btn:active {
    transform: translateY(1px);
}

/* Delete buttons */
.delete-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    min-width: 32px;
    transition: all 0.2s ease;
    margin-left: 0.5rem;
}

.delete-btn:hover {
    background: #c82333;
    transform: translateY(-1px);
}

.delete-btn:active {
    transform: translateY(1px);
}

.danger-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.danger-btn:hover:not(:disabled) {
    background: #c82333;
    transform: translateY(-1px);
}

.danger-btn:disabled {
    background: #ced4da;
    color: #6c757d;
    cursor: not-allowed;
    transform: none;
}

/* Content actions container */
.content-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-top: 0.5rem;
}

/* Logout button */
.logout-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s ease;
}

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

/* Status indicators */
.status-connected::before {
    content: "●";
    margin-right: 0.5rem;
    color: #28a745;
}

.status-disconnected::before {
    content: "●";
    margin-right: 0.5rem;
    color: #6c757d;
}

.status-reconnecting::before {
    content: "●";
    margin-right: 0.5rem;
    color: #ffc107;
    animation: pulse 1s infinite;
}

.status-error::before {
    content: "●";
    margin-right: 0.5rem;
    color: #dc3545;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* Button states */
.primary-btn:disabled,
.secondary-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.primary-btn:disabled:hover,
.secondary-btn:disabled:hover {
    background: inherit;
}

/* Form validation */
.input-error {
    border-color: #dc3545 !important;
}

.input-success {
    border-color: #28a745 !important;
}

/* Loading states */
.btn-loading {
    position: relative;
    color: transparent !important;
}

.btn-loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

/* Mobile-specific components */
@media (max-width: 768px) {
    .content-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .copy-btn {
        align-self: stretch;
        text-align: center;
        margin-top: 0.5rem;
    }

    .status-indicator {
        flex-direction: column;
        text-align: center;
    }
}

/* Popup Modal Confirmation Dialog */
.confirmation-dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    animation: fadeIn 0.2s ease-out forwards;
}

.confirmation-dialog {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-width: 400px;
    min-width: 320px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    animation: slideIn 0.2s ease-out forwards;
    animation-delay: 0.05s;
}

/* Dialog Header */
.dialog-header {
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    padding: 1.25rem 1.5rem;
}

.dialog-header h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: #343a40;
}

/* Dialog Content */
.dialog-content {
    padding: 1.5rem;
    max-height: 300px;
    overflow-y: auto;
}

.dialog-content p {
    margin: 0 0 1rem 0;
    line-height: 1.5;
    color: #495057;
}

.dialog-content p:last-child {
    margin-bottom: 0;
}

/* Warning Content for Bulk Delete */
.warning-content {
    text-align: center;
}

.warning-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.warning-content p {
    margin-bottom: 1rem;
}

.warning-content strong {
    color: #dc3545;
    font-weight: 600;
}

/* Text Confirmation Input */
.text-confirmation {
    margin-top: 1.5rem;
    text-align: left;
}

.text-confirmation label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #495057;
}

.confirmation-input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #ced4da;
    border-radius: 6px;
    font-size: 0.875rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.confirmation-input:focus {
    outline: none;
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* Dialog Actions */
.dialog-actions {
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    padding: 1rem 1.5rem;
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

.dialog-actions button {
    padding: 0.5rem 1.25rem;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
}

.btn-cancel {
    background: #6c757d;
    color: white;
}

.btn-cancel:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

.btn-confirm {
    background: #dc3545;
    color: white;
}

.btn-confirm:hover:not(:disabled) {
    background: #c82333;
    transform: translateY(-1px);
}

.btn-confirm:disabled {
    background: #ced4da;
    color: #6c757d;
    cursor: not-allowed;
    transform: none;
}

.btn-confirm.enabled {
    background: #dc3545;
    color: white;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

@keyframes slideOut {
    from {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
    to {
        transform: scale(0.9) translateY(20px);
        opacity: 0;
    }
}

/* Closing animation */
.confirmation-dialog-overlay.closing {
    animation: fadeOut 0.15s ease-in forwards;
}

.confirmation-dialog-overlay.closing .confirmation-dialog {
    animation: slideOut 0.15s ease-in forwards;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .confirmation-dialog {
        width: 95%;
        max-width: none;
        margin: 1rem;
    }

    .dialog-header {
        padding: 1rem;
    }

    .dialog-content {
        padding: 1rem;
    }

    .dialog-actions {
        padding: 1rem;
        flex-direction: column-reverse;
    }

    .dialog-actions button {
        width: 100%;
        padding: 0.75rem;
    }
}

/* Focus management for accessibility */
.confirmation-dialog-overlay:focus-within .confirmation-dialog {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* File Upload Section */
.file-upload-section {
    margin-bottom: 2rem;
}

.file-upload-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.upload-status {
    font-size: 14px;
    color: #666;
    font-style: italic;
}

.upload-status.active {
    color: #007bff;
    font-weight: 500;
}

.file-drop-container {
    margin-bottom: 1rem;
}

/* File List Styles */
.file-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.file-item {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: box-shadow 0.2s ease;
}

.file-item:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

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

.file-icon {
    font-size: 24px;
    min-width: 24px;
}

.file-details {
    flex-grow: 1;
}

.file-name {
    font-weight: 500;
    color: #333;
    margin-bottom: 0.25rem;
    word-break: break-all;
}

.file-meta {
    display: flex;
    gap: 1rem;
    font-size: 12px;
    color: #666;
}

.file-actions {
    display: flex;
    gap: 0.5rem;
}

.file-download-btn,
.file-delete-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.file-download-btn:hover {
    background-color: #e3f2fd;
}

.file-delete-btn:hover {
    background-color: #ffebee;
}

/* Responsive design for file items */
@media (max-width: 768px) {
    .file-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .file-info {
        width: 100%;
    }

    .file-meta {
        flex-direction: column;
        gap: 0.25rem;
    }

    .file-actions {
        align-self: flex-end;
    }
}

/* Dark mode support (if needed in future) */
@media (prefers-color-scheme: dark) {
    /* Add dark mode styles here if needed */
}