/* Modern styles for the personal cloud storage app */

/* Root variables for consistent theming */
:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --card-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --hover-shadow: 0 12px 48px rgba(0, 0, 0, 0.4);
    --border-radius: 16px;
    --border-radius-sm: 8px;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
}

/* Global styles */
body {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
}

/* Glassmorphism effect */
.glass-effect {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
}

/* Enhanced navbar */
.navbar {
    background: var(--glass-bg) !important;
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    padding: 1rem 0;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Modern table design */
.table-responsive {
    border-radius: var(--border-radius);
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--card-shadow);
    overflow: hidden;
}

.table {
    margin-bottom: 0;
    background: transparent;
}

.table th {
    border-top: none;
    border-bottom: 2px solid var(--glass-border);
    font-weight: 600;
    background: rgba(255, 255, 255, 0.05);
    color: var(--bs-light);
    padding: 1rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table td {
    vertical-align: middle;
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.table tbody tr:hover td {
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-1px);
}

/* Enhanced buttons */
.btn {
    border-radius: var(--border-radius-sm);
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: var(--primary-gradient);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
}

.btn-secondary {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    color: var(--bs-light);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.btn-group .btn {
    border-radius: var(--border-radius-sm);
    margin-right: 0.5rem;
}

.btn-group .btn:last-child {
    margin-right: 0;
}

/* Vertical button layout for mobile */
@media (max-width: 576px) {
    .btn-group {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }
    
    .btn-group .btn {
        margin-right: 0;
        margin-bottom: 0.25rem;
        border-radius: var(--border-radius-sm);
        width: 100%;
    }
    
    .btn-group .btn:last-child {
        margin-bottom: 0;
    }
}

/* Enhanced breadcrumb */
.breadcrumb {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 1rem 1.5rem;
    box-shadow: var(--card-shadow);
}

.breadcrumb-item a {
    color: var(--bs-light);
    text-decoration: none;
    transition: all 0.3s ease;
}

.breadcrumb-item a:hover {
    color: var(--bs-primary);
    text-decoration: none;
    transform: translateX(2px);
}

/* Enhanced modals */
.modal-content {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    box-shadow: var(--hover-shadow);
}

.modal-header {
    border-bottom: 1px solid var(--glass-border);
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid var(--glass-border);
    padding: 1.5rem;
}

.modal-title {
    font-weight: 600;
    color: var(--bs-light);
}

/* Enhanced alerts */
.alert {
    border-radius: var(--border-radius);
    border: none;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.alert-success {
    background: var(--success-gradient);
    color: white;
}

.alert-danger {
    background: var(--secondary-gradient);
    color: white;
}

/* Enhanced cards */
.card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--hover-shadow);
}

/* Enhanced form controls */
.form-control {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-sm);
    color: var(--bs-light);
    transition: all 0.3s ease;
}

.form-control:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--bs-primary);
    color: var(--bs-light);
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
    transform: translateY(-2px);
}

.input-group-text {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    color: var(--bs-light);
}

.text-muted {
    color: rgba(255, 255, 255, 0.7) !important;
}

/* Action buttons container */
.action-buttons {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--card-shadow);
}

/* Enhanced file icons */
.file-icon {
    font-size: 1.2rem;
    margin-right: 0.5rem;
}

.bi-file-earmark {
    color: #4facfe;
}

.bi-folder-fill {
    color: #ffc107;
}

/* Loading animation for file uploads */
.upload-progress {
    display: none;
    margin-top: 1rem;
}

.upload-progress .progress {
    height: 0.75rem;
    background: var(--glass-bg);
    border-radius: var(--border-radius-sm);
    overflow: hidden;
}

.progress-bar {
    background: var(--primary-gradient);
    border-radius: var(--border-radius-sm);
    transition: width 0.3s ease;
}

/* Enhanced empty state */
.empty-state {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 3rem;
    text-align: center;
    box-shadow: var(--card-shadow);
}

.empty-state .display-1 {
    font-size: 4rem;
    opacity: 0.6;
    margin-bottom: 1rem;
}

.empty-state h3 {
    color: var(--bs-light);
    margin-bottom: 1rem;
}

.empty-state p {
    color: rgba(255, 255, 255, 0.7);
}

/* Responsive improvements */
@media (max-width: 768px) {
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .table td {
        padding: 0.75rem 0.5rem;
        word-break: break-word;
    }
    
    .table th {
        padding: 0.75rem 0.5rem;
        font-size: 0.8rem;
    }
    
    .breadcrumb {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
    
    .modal-dialog {
        margin: 0.5rem;
    }
    
    .action-buttons {
        padding: 1rem;
    }
    
    .navbar-brand {
        font-size: 1.25rem;
    }
}

/* Actions column specific responsive styling */
@media (max-width: 576px) {
    .table td:last-child {
        min-width: 120px;
    }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 4px;
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Focus states */
.btn:focus,
.form-control:focus,
.btn-close:focus {
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* Animations */
@keyframes slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.alert {
    animation: slideIn 0.3s ease-out;
}

.card {
    animation: fadeIn 0.5s ease-out;
}

.btn-primary:active {
    animation: pulse 0.2s ease-out;
}

/* Login page enhancements */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
}

.login-card {
    max-width: 400px;
    width: 100%;
    margin: 2rem;
}

.login-icon {
    font-size: 3rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
}

/* Share page enhancements */
.share-header {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--card-shadow);
    text-align: center;
}

.share-header h2 {
    color: var(--bs-light);
    margin-bottom: 0.5rem;
}

.share-header p {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0;
}

/* Enhanced hover effects */
.table tbody tr {
    transition: all 0.3s ease;
}

.table tbody tr:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* Button hover effects */
.btn-sm:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.btn-outline-primary:hover {
    background: var(--primary-gradient);
    border-color: transparent;
    transform: translateY(-2px);
}

.btn-outline-info:hover {
    background: var(--success-gradient);
    border-color: transparent;
    transform: translateY(-2px);
}

.btn-outline-warning:hover {
    background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%);
    border-color: transparent;
    transform: translateY(-2px);
}

.btn-outline-danger:hover {
    background: var(--secondary-gradient);
    border-color: transparent;
    transform: translateY(-2px);
}

/* Drag and drop styles */
.drag-over {
    position: relative;
}

.drag-over::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(102, 126, 234, 0.1);
    border: 3px dashed var(--bs-primary);
    border-radius: var(--border-radius);
    z-index: 1000;
    pointer-events: none;
}

.drag-over::after {
    content: 'Drop files here to upload';
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--primary-gradient);
    color: white;
    padding: 2rem 3rem;
    border-radius: var(--border-radius);
    font-size: 1.2rem;
    font-weight: 600;
    z-index: 1001;
    pointer-events: none;
    box-shadow: var(--hover-shadow);
}

/* Loading states */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Enhanced tooltips */
[data-bs-toggle="tooltip"] {
    position: relative;
}

/* File type specific icons */
.file-icon[data-type="pdf"] {
    color: #ff6b6b;
}

.file-icon[data-type="image"] {
    color: #4ecdc4;
}

.file-icon[data-type="video"] {
    color: #ffe66d;
}

.file-icon[data-type="audio"] {
    color: #ff6b9d;
}

.file-icon[data-type="code"] {
    color: #95e1d3;
}

.file-icon[data-type="text"] {
    color: #a8dadc;
}

/* Additional file type icons */
.bi-image {
    color: #4ecdc4;
}

.bi-play-circle {
    color: #ffe66d;
}

.bi-music-note {
    color: #ff6b9d;
}

.bi-file-earmark-code {
    color: #95e1d3;
}

.bi-file-earmark-pdf {
    color: #ff6b6b;
}

/* Badge styling */
.badge {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
}

/* Enhanced modal backdrop */
.modal-backdrop {
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

/* Performance optimizations */
.table-responsive {
    will-change: transform;
}

.btn {
    will-change: transform;
}

/* Enhanced focus indicators */
.form-control:focus,
.btn:focus {
    outline: 2px solid var(--bs-primary);
    outline-offset: 2px;
}

/* Dark mode enhancements */
@media (prefers-color-scheme: dark) {
    :root {
        --glass-bg: rgba(255, 255, 255, 0.08);
        --glass-border: rgba(255, 255, 255, 0.15);
    }
}
