/* ============================================
   Printer Profile Manager Styles
   ============================================ */

.printer-profiles-section {
    background: var(--card-bg);
    border: 2px solid var(--success);
    padding: 30px;
    border-radius: var(--radius-lg);
    margin: 30px 0;
}

.section-header {
    margin-bottom: 25px;
}

/* Collapsible Section Header */
.section-header-collapsible {
    cursor: pointer;
    user-select: none;
    transition: all var(--transition-fast);
    padding: 10px;
    margin: -10px -10px 15px -10px;
    border-radius: var(--radius-sm);
}

.section-header-collapsible:hover {
    background: var(--primary-light);
}

.section-header-collapsible:active {
    transform: scale(0.98);
}

.section-header-content {
    pointer-events: none; /* Let clicks pass through to parent */
}

.section-header h3 {
    color: var(--success);
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Collapse Indicator */
.collapse-indicator {
    display: inline-block;
    font-size: 0.8em;
    width: 20px;
    transition: transform 0.3s ease;
    color: var(--success);
}

.section-collapsible-content {
    transition: all 0.3s ease;
    overflow: hidden;
}

.info-tooltip {
    background: var(--info);
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.9em;
    transition: all var(--transition-fast);
    pointer-events: auto; /* Re-enable pointer events for this button */
}

.info-tooltip:hover {
    background: var(--primary);
    transform: scale(1.1);
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 0.95em;
    margin: 0;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-icon {
    font-size: 4em;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 1.1em;
}

/* Printers Grid (now displays rows) */
.printers-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 25px;
}

/* Printer Row */
.printer-row {
    background: var(--background);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all var(--transition-fast);
}

.printer-row:hover {
    border-color: var(--success);
    box-shadow: var(--shadow-sm);
}

/* Printer Row Header */
.printer-row-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    background: var(--card-bg);
}

/* Expand Button */
.btn-expand {
    background: var(--background);
    border: 2px solid var(--border);
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.btn-expand:hover {
    background: var(--primary);
    border-color: var(--primary);
    transform: scale(1.05);
}

.btn-expand:hover .expand-icon {
    color: white;
}

.expand-icon {
    font-size: 1.4em;
    font-weight: 700;
    line-height: 1;
    color: var(--success);
    transition: all var(--transition-fast);
}

/* Printer Row Info */
.printer-row-info {
    flex: 1;
    min-width: 0;
}

.printer-row-name {
    color: var(--text-primary);
    margin: 0 0 5px 0;
    font-size: 1.2em;
    font-weight: 600;
}

.printer-row-summary {
    color: var(--text-secondary);
    font-size: 0.95em;
}

/* Printer Actions */
.printer-actions {
    display: flex;
    gap: 5px;
    flex-shrink: 0;
}

.btn-icon {
    background: var(--background);
    border: 1px solid var(--border);
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 1em;
    transition: all var(--transition-fast);
    padding: 0;
}

.btn-icon:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: scale(1.1);
}

.btn-danger-icon:hover {
    background: var(--error);
    border-color: var(--error);
}

/* Printer Row Details (Expandable) */
.printer-row-details {
    padding: 20px;
    background: var(--background);
    border-top: 2px solid var(--border);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 500px;
    }
}

.printer-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.printer-detail {
    color: var(--text-primary);
    font-size: 1em;
}

.printer-detail strong {
    color: var(--success);
    display: block;
    margin-bottom: 5px;
}

.printer-detail.full-width {
    grid-column: 1 / -1;
}

.printer-notes {
    background: var(--info-light);
    padding: 10px;
    border-radius: var(--radius-sm);
    margin-top: 5px;
    font-size: 0.95em;
    color: var(--text-secondary);
}

/* Profile Actions */
.profile-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 25px;
    padding-top: 25px;
    border-top: 2px solid var(--border);
}

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

.btn-primary,
.btn-secondary,
.btn-danger {
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 600;
    font-size: 1em;
    transition: all var(--transition-fast);
}

.btn-primary {
    background: var(--success);
    color: white;
}

.btn-primary:hover {
    background: var(--success);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    filter: brightness(1.1);
}

.btn-secondary {
    background: var(--background);
    color: var(--text-primary);
    border: 2px solid var(--border);
}

.btn-secondary:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

.btn-danger {
    background: var(--error);
    color: white;
}

.btn-danger:hover {
    background: var(--error);
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px;
    border-bottom: 2px solid var(--border);
}

.modal-header h3 {
    margin: 0;
    color: var(--primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--error);
    color: white;
}

.modal-body {
    padding: 25px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1em;
    font-family: inherit;
    background: var(--background);
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-group textarea {
    resize: vertical;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 30px;
}

/* First-Time Tip */
.tip-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.tip-modal {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    max-width: 500px;
    width: 100%;
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.3s ease;
}

.tip-header {
    background: var(--success);
    color: white;
    padding: 20px;
    font-size: 1.3em;
    font-weight: 600;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.tip-body {
    padding: 25px;
    color: var(--text-primary);
}

.tip-body p {
    margin: 10px 0;
}

.tip-footer {
    padding: 20px 25px;
    border-top: 2px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Notification */
.notification {
    position: fixed;
    bottom: -100px;
    right: 20px;
    background: var(--success);
    color: white;
    padding: 15px 25px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    font-weight: 600;
    z-index: 10001;
    transition: all 0.3s ease;
}

.notification.show {
    bottom: 20px;
}

.notification-error {
    background: var(--error);
}

.notification-info {
    background: var(--info);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .printer-row-header {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .printer-row-info {
        flex: 1 1 100%;
        order: 1;
    }
    
    .btn-expand {
        order: 0;
    }
    
    .printer-actions {
        order: 2;
        flex: 1 1 auto;
        justify-content: flex-end;
    }
    
    .printer-details-grid {
        grid-template-columns: 1fr;
    }
    
    .profile-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .action-group {
        flex-direction: column;
    }
    
    .btn-primary,
    .btn-secondary,
    .btn-danger {
        width: 100%;
    }
    
    .modal-content {
        margin: 20px;
    }
}
