/* ==================== 現代卡片風格 CSS ==================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-dark: #1a1a1a;
    --bg-card: #2a2a2a;
    --bg-icon: #ffffff;
    --text-primary: #ffffff;
    --text-secondary: #999999;
    --accent-green: #00ff00;
    --border-color: #3a3a3a;
    --card-radius: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ==================== 容器 ==================== */

.container {
    padding: 2rem;
    display: flex;
    flex-direction: column;
}

/* ==================== 頂部欄 ==================== */

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
}

.title {
    font-size: 1.125rem;
    font-weight: 400;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

.icon-btn:hover {
    color: var(--text-primary);
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-green);
    box-shadow: 0 0 8px var(--accent-green);
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* ==================== 硬碟網格 ==================== */

.disk-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 200px));
    gap: 2rem;
    max-width: 1400px;
    justify-content: start;
}

/* ==================== 硬碟卡片 (新風格) ==================== */

.disk-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 1.25rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 200px;
    height: auto;
    min-height: unset;
    max-height: unset;
}

.disk-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
    border-color: #4a4a4a;
}

/* 圖示容器 - 白色背景正方形 */
.disk-icon-container {
    width: 100%;
    aspect-ratio: 1;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.disk-icon {
    width: 70%;
    height: 70%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.disk-icon svg {
    width: 100%;
    height: 100%;
}

/* 硬碟名稱 */
.disk-name {
    font-size: 0.9rem;
    color: var(--text-primary);
    text-align: center;
    font-weight: 400;
    margin-top: 0.875rem;
    letter-spacing: 0.01em;
    line-height: 1.3;
}

/* 資訊圖示 (卡片底部小圓圈) - 已隱藏 */
.disk-info-icon {
    display: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #3a3a3a;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    margin-top: 0.75rem;
    position: relative;
}

.disk-info-icon::before {
    content: 'i';
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-weight: 600;
    font-style: normal;
}

/* 連接狀態指示燈 (硬碟上方) - 閃爍綠燈 */
.disk-status-light {
    position: absolute;
    top: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent-green);
    box-shadow: 0 0 10px var(--accent-green);
    animation: blink 1.5s infinite;
    z-index: 10;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
        box-shadow: 0 0 10px var(--accent-green);
    }

    50% {
        opacity: 0.3;
        box-shadow: 0 0 5px var(--accent-green);
    }
}

/* 連接狀態指示燈 (右上角) - 已隱藏 */
.disk-status-dot {
    display: none;
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-green);
    box-shadow: 0 0 6px var(--accent-green);
}

.disk-card.disconnected .disk-status-dot {
    background: #666666;
    box-shadow: none;
}

/* 隱藏空間資訊 (在 hover 時顯示) */
.disk-space {
    display: none;
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-align: center;
    margin-top: 0.25rem;
}

.disk-card:hover .disk-space {
    display: block;
}

/* ==================== 載入動畫 ==================== */

.loading {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--text-secondary);
    padding: 3rem;
    font-size: 0.875rem;
}

/* ==================== 響應式設計 ==================== */

@media (max-width: 768px) {
    .container {
        padding: 1.5rem;
    }

    .header {
        margin-bottom: 2rem;
    }

    .title {
        font-size: 1rem;
    }

    .disk-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 160px));
        gap: 1.5rem;
    }

    .disk-card {
        width: 160px;
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .disk-grid {
        grid-template-columns: repeat(2, 140px);
        gap: 1rem;
    }

    .disk-card {
        width: 140px;
        padding: 0.875rem;
    }
}

/* ==================== 設定按鈕動畫 ==================== */

.icon-btn svg {
    transition: transform 0.3s ease;
}

.icon-btn:hover svg {
    transform: rotate(90deg);
}

/* ==================== 連線狀態樣式 ==================== */

.disk-status {
    font-size: 0.75rem;
    text-align: center;
    margin-top: 0.5rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 500;
}

.status-connected {
    color: #1e90ff;
    background: rgba(30, 144, 255, 0.1);
}

.status-disconnected {
    color: #808080;
    background: rgba(128, 128, 128, 0.1);
}

.status-checking {
    color: #ffa500;
    background: rgba(255, 165, 0, 0.1);
}

/* 可點擊與禁用狀態 */
.disk-card.clickable {
    cursor: pointer;
}

.disk-card.clickable:hover {
    transform: translateY(-5px);
}

.disk-card.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.disk-card.disabled:hover {
    transform: none;
}

/* ==================== 空白狀態樣式 ==================== */

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.empty-desc {
    font-size: 0.875rem;
    opacity: 0.7;
}