.sidebar {
    width: 250px;
    background: #1E1E1E;
    border-right: 1px solid #333;
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.logo-area {
    margin-bottom: 40px;
}

.logo-link {
    text-decoration: none;
    display: block;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    text-decoration: none;
    color: #AAA;
    border-radius: 6px;
    transition: background 0.2s;
}

.nav-item:hover, .nav-item.active {
    background: #333;
    color: white;
}

.nav-icon {
    filter: invert(0.7);
    opacity: 0.8;
    flex-shrink: 0;
}

.nav-item:hover .nav-icon,
.nav-item.active .nav-icon {
    filter: invert(1);
    opacity: 1;
}

.nav-divider {
    height: 1px;
    background: #333;
    margin: 15px 0;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #121212;
}

/* Dashboard Breadcrumb */
.dashboard-breadcrumb {
    padding: 12px 40px;
    background: #1a1a1a;
    border-bottom: 1px solid #333;
    font-size: 14px;
    color: #888;
    white-space: nowrap;
    overflow-x: auto;
    display: flex;
    align-items: center;
    gap: 4px;
}

.dashboard-breadcrumb .breadcrumb-item {
    color: #2196F3;
    cursor: pointer;
    transition: color 0.2s;
    padding: 4px 8px;
    border-radius: 4px;
}

.dashboard-breadcrumb .breadcrumb-item:hover {
    color: #64B5F6;
    background: rgba(33, 150, 243, 0.1);
}

.dashboard-breadcrumb .breadcrumb-separator {
    color: #555;
    margin: 0 2px;
}

.dashboard-breadcrumb .breadcrumb-current {
    color: #E0E0E0;
    font-weight: 500;
    padding: 4px 8px;
}

.top-bar {
    padding: 25px 40px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #333;
    gap: 20px;
}

.top-bar h1 {
    margin: 0;
    flex-shrink: 0;
}

.top-bar .actions {
    flex-shrink: 0;
}

/* Search Bar */
.search-container {
    flex: 1;
    max-width: 400px;
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    width: 100%;
    height: 38px;
    padding: 0 36px 0 14px;
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.search-input:focus {
    outline: none;
    border-color: #2196F3;
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.2);
}

.search-input::placeholder {
    color: #888;
}

.search-clear {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    font-size: 18px;
    padding: 0;
    line-height: 1;
    display: none;
}

.search-clear:hover {
    color: #fff;
}

.search-container.has-value .search-clear {
    display: block;
}

.content-area {
    padding: 40px;
    overflow-y: auto;
    flex: 1;
}

.simulations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.simulation-card {
    background: #1E1E1E;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    border: 1px solid #333;
}

.simulation-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    border-color: #2196F3;
}

.card-thumb {
    height: 140px;
    background: #2a2a2a; /* Placeholder */
    position: relative;
}

.thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-info {
    padding: 15px;
}

.card-title {
    margin: 0 0 5px 0;
    font-size: 16px;
    font-weight: 500;
}

.card-meta {
    font-size: 12px;
    color: #888;
    display: flex;
    justify-content: space-between;
}

.card-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    opacity: 0;
    transition: opacity 0.2s;
}

.simulation-card:hover .card-actions {
    opacity: 1;
}

.btn-icon {
    background: rgba(0,0,0,0.6);
    color: white;
    border: none;
    border-radius: 4px;
    width: 28px;
    height: 28px;
    cursor: pointer;
}

.btn-primary {
    background: #2196F3;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
}

.btn-primary:hover {
    background: #1976D2;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.7);
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: #1E1E1E;
    width: 500px;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}

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

.close-modal {
    background: none;
    border: none;
    color: #AAA;
    font-size: 24px;
    cursor: pointer;
}

.input-group {
    display: flex;
    gap: 10px;
}

input[type="email"], input[type="text"], select {
    background: #2A2A2A;
    border: 1px solid #444;
    color: white;
    padding: 8px;
    border-radius: 4px;
    flex: 1;
}

.share-list {
    margin-top: 20px;
    border-top: 1px solid #333;
    padding-top: 10px;
}

.share-list ul {
    list-style: none;
    padding: 0;
}

.collaborator-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #2A2A2A;
}

/* File List Grid - Dashboard Style */
.file-list-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    padding: 10px;
}

.file-list-grid .file-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 15px;
    background: #1E1E1E;
    border: 1px solid #333;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    min-height: 160px;
}

.file-list-grid .file-item:hover {
    background: #2a2a2a;
    border-color: #2196F3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.file-list-grid .file-item.openfoam-case {
    border-color: #4CAF50;
    background: rgba(76, 175, 80, 0.08);
}

.file-list-grid .file-item.openfoam-case:hover {
    background: rgba(76, 175, 80, 0.15);
    border-color: #66BB6A;
}

/* File Icon */
.file-list-grid .file-icon {
    font-size: 48px;
    margin-bottom: 12px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-list-grid .file-icon-img {
    width: 48px;
    height: 48px;
    filter: invert(1) brightness(1.2);
    opacity: 0.9;
}

/* Breadcrumb icon */
.breadcrumb-icon {
    vertical-align: middle;
    filter: invert(1) brightness(1.2);
    opacity: 0.8;
    margin-right: 4px;
}

/* File Name */
.file-list-grid .file-name {
    font-size: 14px;
    font-weight: 500;
    color: #E0E0E0;
    text-align: center;
    word-break: break-word;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-bottom: 8px;
}

/* Case Badge */
.file-list-grid .case-badge {
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 10px;
    background: #4CAF50;
    color: white;
    font-weight: 500;
    margin-bottom: 8px;
}

/* File Meta (size + date) */
.file-list-grid .file-meta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    margin-top: auto;
}

.file-list-grid .file-size {
    font-size: 12px;
    color: #2196F3;
    font-weight: 500;
}

.file-list-grid .file-date {
    font-size: 11px;
    color: #888;
}

.file-list-grid .shared-by {
    font-size: 11px;
    color: #AF52DE;
    font-weight: 500;
}

/* Action Buttons Container - Left side, vertical layout */
.file-list-grid .card-actions {
    position: absolute;
    top: 8px;
    left: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.file-list-grid .file-item:hover .card-actions {
    opacity: 1;
}

/* Action Buttons */
.file-list-grid .btn-action {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: white;
}

.file-list-grid .btn-action:hover {
    transform: scale(1.1);
}

/* Download button - green color */
.file-list-grid .btn-download {
    background: #4CAF50;
    position: relative;
}

.file-list-grid .btn-download:hover {
    background: #388E3C;
}

/* Download button progress state */
.file-list-grid .btn-download.downloading {
    background: rgba(76, 175, 80, 0.15);
    pointer-events: none;
    position: relative;
}

.file-list-grid .btn-download.downloading .action-icon {
    display: none;
}

.file-list-grid .btn-download.downloading .download-progress {
    display: block;
}

/* Square border progress indicator for download */
.download-progress {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.download-progress svg {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.download-progress .progress-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.2);
    stroke-width: 2;
}

.download-progress .progress-ring {
    fill: none;
    stroke: #4CAF50;
    stroke-width: 2;
    stroke-linecap: round;
    /* Perimeter of rounded rect 26x26 with rx=5: 4*(26-2*5) + 2*PI*5 ≈ 95.4 */
    stroke-dasharray: 95.4;
    stroke-dashoffset: 95.4;
    transition: stroke-dashoffset 0.15s ease;
}

.download-progress .progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 8px;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 0 2px rgba(0,0,0,0.5);
    z-index: 1;
}

.file-list-grid .btn-share {
    background: #2196F3;
}

.file-list-grid .btn-share:hover {
    background: #1976D2;
}

.file-list-grid .btn-rename {
    background: #FF9800;
}

.file-list-grid .btn-rename:hover {
    background: #F57C00;
}

.file-list-grid .btn-delete {
    background: #f44336;
}

.file-list-grid .btn-delete:hover {
    background: #d32f2f;
}

/* Action button icons */
.action-icon {
    filter: invert(1);
    opacity: 0.9;
}

.btn-action:hover .action-icon {
    opacity: 1;
}

/* User Profile in Sidebar */
.user-profile {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-info {
    font-size: 14px;
    color: #ccc;
}

.btn-text {
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    font-size: 13px;
}

.btn-text:hover {
    color: #f44336;
}

/* Loading and Error States */
.loading-spinner {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: #888;
}

.error {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: #f44336;
    background: rgba(244, 67, 54, 0.1);
    border-radius: 8px;
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 40px;
    color: #888;
}

/* Secondary Button */
.btn-secondary {
    background: #444;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}

.btn-secondary:hover {
    background: #555;
}

/* Form Group in Modals */
.modal-body .form-group {
    margin-bottom: 15px;
}

.modal-body .form-group label {
    display: block;
    margin-bottom: 8px;
    color: #ccc;
    font-size: 14px;
}

.modal-body .form-group input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 6px;
    color: #fff;
    font-size: 14px;
    box-sizing: border-box;
}

.modal-body .form-group input[type="text"]:focus {
    outline: none;
    border-color: #2196F3;
}

/* Danger Button */
.btn-danger {
    background: #f44336;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
}

.btn-danger:hover {
    background: #d32f2f;
}

/* ===== Share Modal Styles ===== */
.share-modal-content {
    width: 480px;
    max-width: 95vw;
}

.share-modal-content .modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    margin: 0;
}

.share-section {
    margin-bottom: 24px;
}

.share-section:last-child {
    margin-bottom: 0;
}

.share-section-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #aaa;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Invite Row */
.share-invite-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.share-email-input {
    flex: 1;
    background: #2a2a2a;
    border: 1px solid #444;
    color: #fff;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.share-email-input:focus {
    outline: none;
    border-color: #2196F3;
}

.share-email-input::placeholder {
    color: #666;
}

.share-role-select {
    background: #2a2a2a;
    border: 1px solid #444;
    color: #fff;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    min-width: 120px;
}

.share-role-select:focus {
    outline: none;
    border-color: #2196F3;
}

.share-send-btn {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}

/* Collaborators List */
.share-collaborators {
    border-top: 1px solid #333;
    padding-top: 20px;
}

.collaborators-list {
    max-height: 200px;
    overflow-y: auto;
}

.empty-collaborators {
    color: #666;
    font-size: 14px;
    font-style: italic;
    padding: 16px;
    text-align: center;
    background: #1a1a1a;
    border-radius: 8px;
}

.collaborator-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: #1a1a1a;
    border-radius: 8px;
    margin-bottom: 8px;
}

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

.collaborator-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.collaborator-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2196F3, #30D158);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: white;
}

.collaborator-details {
    display: flex;
    flex-direction: column;
}

.collaborator-name {
    font-size: 14px;
    font-weight: 500;
    color: #fff;
}

.collaborator-email {
    font-size: 12px;
    color: #888;
}

.collaborator-role {
    font-size: 12px;
    color: #2196F3;
    padding: 4px 10px;
    background: rgba(33, 150, 243, 0.15);
    border-radius: 12px;
}

.collaborator-remove {
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    padding: 4px 8px;
    font-size: 18px;
    transition: color 0.2s;
}

.collaborator-remove:hover {
    color: #f44336;
}

.remove-collaborator-btn {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 6px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    margin-left: auto;
}

.remove-collaborator-btn:hover {
    color: #f44336;
    background: rgba(244, 67, 54, 0.1);
}

.collaborator-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Public Link Section */
.share-public-link {
    border-top: 1px solid #333;
    padding-top: 20px;
}

.public-link-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.public-link-toggle input[type="checkbox"] {
    display: none;
}

.toggle-slider {
    width: 44px;
    height: 24px;
    background: #444;
    border-radius: 12px;
    position: relative;
    transition: background 0.2s;
}

.toggle-slider::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: transform 0.2s;
}

.public-link-toggle input[type="checkbox"]:checked + .toggle-slider {
    background: #2196F3;
}

.public-link-toggle input[type="checkbox"]:checked + .toggle-slider::after {
    transform: translateX(20px);
}

.toggle-label {
    font-size: 14px;
    color: #ccc;
    font-weight: 500;
}

.public-link-container {
    display: flex !important;
    flex-direction: row !important;
    margin-top: 10px;
    gap: 8px;
    align-items: center !important;
}

.public-link-input {
    flex: 1;
    background: #1a1a1a;
    border: 1px solid #444;
    color: #2196F3;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-family: monospace;
    height: 40px;
    box-sizing: border-box;
}

.btn-copy {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: #2196F3;
    color: white;
    border: none;
    padding: 0 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.2s;
    white-space: nowrap;
    height: 40px;
    box-sizing: border-box;
    flex-shrink: 0;
}

.btn-copy:hover {
    background: #1976D2;
}

.btn-copy.copied {
    background: #4CAF50;
}

.copy-icon {
    font-size: 14px;
}
