/* Legacy Binder Styles */

/* Main Layout */
.binder-container {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 20px;
    height: calc(100vh - 80px);
    /* Subtract Header */
    padding: 20px;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

@media (max-width: 800px) {
    .binder-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
        height: auto;
    }
}

/* Sidebar (Tree View) */
.binder-sidebar {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid #eee;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.binder-header-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

/* Tree Root */
.tree-root>.tree-children {
    list-style: none;
    padding-left: 0;
}

/* Sub Trees (Nesting) */
.tree-node .tree-children {
    list-style: none;
    padding-left: 20px;
    display: none;
    /* Collapsed by default */
}

/* Expanded State */
.tree-node.expanded>.tree-children {
    display: block;
}

.tree-item {
    padding: 8px 10px;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    color: #444;
    transition: background 0.1s;
}

.tree-item:hover {
    background: #f5f5f5;
}

.tree-item.active {
    background: #e3f2fd;
    color: #1976d2;
    font-weight: 500;
}

.tree-icon {
    margin-right: 8px;
    font-size: 1.1em;
}

.tree-expander {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 5px;
    cursor: pointer;
    color: #999;
    font-size: 0.8em;
}

.tree-expander:hover {
    color: #333;
}

/* Content Area */
.binder-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid #eee;
    padding: 30px;
    overflow-y: auto;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
}

.content-title {
    margin: 0;
    font-family: 'Merriweather', serif;
    color: #2c3e50;
    font-size: 1.8rem;
}

.content-toolbar {
    display: flex;
    gap: 10px;
}

/* Fields Grid */
.fields-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.field-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    background: #fafafa;
    position: relative;
    transition: box-shadow 0.2s;
}

.field-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    background: white;
}

.field-label {
    font-size: 0.85em;
    color: #666;
    margin-bottom: 5px;
    font-weight: 500;
    display: block;
}

.field-value {
    font-size: 1.1em;
    color: #333;
    font-weight: 500;
    min-height: 24px;
    display: flex;
    align-items: center;
}

.field-value.password-mask {
    color: #999;
    letter-spacing: 3px;
    cursor: pointer;
}

.field-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    opacity: 0;
    transition: opacity 0.2s;
}

.field-card:hover .field-actions {
    opacity: 1;
}

.btn-icon-small {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1em;
    padding: 4px;
    color: #777;
    border-radius: 4px;
}

.btn-icon-small:hover {
    background: #eee;
    color: #333;
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 40px;
    color: #888;
}

/* Modals for Binder */
.binder-modal .input-group {
    margin-bottom: 15px;
}

.binder-modal label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #444;
}

.binder-modal input,
.binder-modal select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1em;
}

/* Alerts / Dashboard */
.alert-item {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    background: #fff3e0;
    border-left: 4px solid #ff9800;
    border-radius: 4px;
    margin-bottom: 10px;
}

.alert-item.urgent {
    background: #ffebee;
    border-left-color: #f44336;
}

.alert-info {
    flex: 1;
}

.alert-days {
    font-weight: bold;
    font-size: 0.9em;
    color: #d32f2f;
}

/* Print Styles */
@media print {
    body * {
        visibility: hidden;
    }

    #view-binder,
    #view-binder * {
        visibility: visible;
    }

    #view-binder {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        background: white;
    }

    .binder-sidebar,
    .content-toolbar,
    .binder-header-actions,
    .field-actions,
    header {
        display: none !important;
    }

    .binder-container {
        display: block;
        padding: 0;
        height: auto;
    }

    .binder-content {
        box-shadow: none;
        border: none;
        padding: 0;
    }
}

/* Drag & Drop Visuals */
.tree-node.dragging>.tree-item {
    opacity: 0.5;
    background: #e3f2fd;
}

.tree-node.drag-over>.tree-item {
    background: #e8f5e9;
    border: 2px dashed #4caf50;
    box-sizing: border-box;
}