/* Button Components */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    position: relative;
    overflow: hidden;
}

.btn-primary::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;
}

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

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
    border: 2px solid var(--secondary-color);
    transition: all 0.3s ease;
}

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

.btn-large {
    padding: var(--spacing-md) var(--spacing-lg);
    font-size: 1.125rem;
}

/* Device Cards */
.devices-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.device-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.device-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.device-card:hover::before {
    transform: scaleX(1);
}

.device-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.device-card-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.device-photo {
    width: 60px;
    height: 60px;
    border-radius: var(--border-radius);
    overflow: hidden;
    background: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.device-photo i {
    font-size: 1.5rem;
    color: var(--text-light);
}

.device-info h3 {
    margin-bottom: var(--spacing-xs);
    color: var(--text-color);
}

    .device-info p {
        margin-bottom: 0;
        color: var(--text-light);
        font-size: 0.875rem;
    }

    /* Device Details for Chargers */
    .device-details {
        display: flex;
        gap: var(--spacing-sm);
        margin-top: var(--spacing-xs);
        flex-wrap: wrap;
    }

    .device-power,
    .device-location {
        display: flex;
        align-items: center;
        gap: 0.25rem;
        font-size: 0.75rem;
        color: var(--text-light);
        background: var(--bg-light);
        padding: 0.25rem 0.5rem;
        border-radius: 0.25rem;
        border: 1px solid var(--border-color);
    }

    .device-power i {
        color: var(--accent-color);
    }

    .device-location i {
        color: var(--primary-color);
    }

    /* Status Badges */
    .device-status-badge {
        display: inline-flex;
        align-items: center;
        gap: 0.25rem;
        font-size: 0.75rem;
        font-weight: 500;
        padding: 0.25rem 0.5rem;
        border-radius: 0.25rem;
        margin-top: var(--spacing-xs);
        border: 1px solid;
    }

    .status-active {
        background: rgba(0, 184, 148, 0.1);
        color: var(--success-color);
        border-color: var(--success-color);
    }

    .status-charging {
        background: rgba(253, 203, 110, 0.1);
        color: var(--warning-color);
        border-color: var(--warning-color);
    }

    .status-available {
        background: rgba(116, 185, 255, 0.1);
        color: var(--info-color);
        border-color: var(--info-color);
    }

    .status-offline {
        background: rgba(225, 112, 85, 0.1);
        color: var(--error-color);
        border-color: var(--error-color);
    }

    .status-maintenance {
        background: rgba(108, 92, 231, 0.1);
        color: var(--secondary-color);
        border-color: var(--secondary-color);
    }

    .status-error {
        background: rgba(225, 112, 85, 0.1);
        color: var(--error-color);
        border-color: var(--error-color);
    }

    .status-unknown {
        background: rgba(99, 110, 114, 0.1);
        color: var(--text-light);
        border-color: var(--text-light);
    }

.device-actions {
    display: flex;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
}

.device-actions .btn {
    flex: 1;
    font-size: 0.875rem;
    padding: var(--spacing-xs) var(--spacing-sm);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: var(--spacing-2xl);
    color: var(--text-light);
}

.empty-state i {
    font-size: 4rem;
    color: var(--border-color);
    margin-bottom: var(--spacing-lg);
}

.empty-state h3 {
    margin-bottom: var(--spacing-md);
    color: var(--text-color);
}

.empty-state p {
    margin-bottom: var(--spacing-xl);
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.empty-state-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 12px 24px;
    font-size: 1rem;
    line-height: 1;
}

.empty-state-btn i {
    font-size: 1rem;
    line-height: 1;
    vertical-align: middle;
    display: inline-block;
}

.empty-state-btn span {
    font-weight: 500;
    line-height: 1;
    vertical-align: middle;
    display: inline-block;
}

/* Transaction Items */
.transactions-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
}

.transaction-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: var(--spacing-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.transaction-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow);
}

.transaction-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: white;
}

.transaction-icon.success {
    background: var(--success-color);
}

.transaction-icon.pending {
    background: var(--warning-color);
}

.transaction-icon.failed {
    background: var(--error-color);
}

.transaction-details {
    flex: 1;
}

.transaction-details h4 {
    margin-bottom: var(--spacing-xs);
    color: var(--text-color);
}

.transaction-details p {
    margin-bottom: 0;
    color: var(--text-light);
    font-size: 0.875rem;
}

.transaction-amount {
    font-weight: 700;
    color: var(--text-color);
}

.transaction-amount.positive {
    color: var(--success-color);
}

.transaction-amount.negative {
    color: var(--error-color);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 3000;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-md);
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
}

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

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

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-light);
    cursor: pointer;
    padding: var(--spacing-xs);
    border-radius: var(--border-radius);
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: var(--bg-light);
    color: var(--text-color);
}

.modal-body {
    padding: var(--spacing-lg);
}

/* Device Detail in Modal */
.device-detail {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: var(--spacing-lg);
}

.device-detail .device-photo {
    width: 100%;
    height: 200px;
}

.device-detail .device-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.device-endpoints {
    margin: var(--spacing-md) 0;
}

.endpoint {
    margin-bottom: var(--spacing-sm);
    padding: var(--spacing-sm);
    background: var(--bg-light);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.endpoint strong {
    color: var(--text-color);
}

.endpoint span {
    color: var(--text-light);
    font-family: monospace;
    font-size: 0.875rem;
}

.device-address {
    margin-top: var(--spacing-md);
    padding: var(--spacing-sm);
    background: var(--bg-light);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.device-address strong {
    color: var(--text-color);
}

.device-address span {
    color: var(--primary-color);
    font-family: monospace;
    font-size: 0.875rem;
}

/* Load More Button */
.load-more {
    text-align: center;
    margin-top: var(--spacing-xl);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 100px;
    right: var(--spacing-md);
    z-index: 4000;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    max-width: 400px;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: var(--spacing-md);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm);
    animation: slideIn 0.3s ease;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.toast.hiding {
    animation: slideOut 0.3s ease forwards;
}

.toast-icon {
    font-size: 1.25rem;
    margin-top: 2px;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
    color: var(--text-color);
}

.toast-message {
    color: var(--text-light);
    font-size: 0.875rem;
    margin-bottom: 0;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: var(--spacing-xs);
    border-radius: var(--border-radius);
    transition: all 0.2s ease;
}

.toast-close:hover {
    background: var(--bg-light);
    color: var(--text-color);
}

/* Toast Types */
.toast.success {
    border-left: 4px solid var(--success-color);
    background: linear-gradient(135deg, rgba(0, 184, 148, 0.1), rgba(0, 184, 148, 0.05));
}

.toast.success .toast-icon {
    color: var(--success-color);
}

.toast.error {
    border-left: 4px solid var(--error-color);
    background: linear-gradient(135deg, rgba(225, 112, 85, 0.1), rgba(225, 112, 85, 0.05));
}

.toast.error .toast-icon {
    color: var(--error-color);
}

.toast.warning {
    border-left: 4px solid var(--warning-color);
    background: linear-gradient(135deg, rgba(253, 203, 110, 0.1), rgba(253, 203, 110, 0.05));
}

.toast.warning .toast-icon {
    color: var(--warning-color);
}

.toast.info {
    border-left: 4px solid var(--info-color);
    background: linear-gradient(135deg, rgba(116, 185, 255, 0.1), rgba(116, 185, 255, 0.05));
}

.toast.info .toast-icon {
    color: var(--info-color);
}

/* Toast Progress Bar */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: var(--primary-color);
    animation: progressBar 8s linear;
}

.toast.success .toast-progress {
    background: var(--success-color);
}

.toast.error .toast-progress {
    background: var(--error-color);
}

.toast.warning .toast-progress {
    background: var(--warning-color);
}

.toast.info .toast-progress {
    background: var(--info-color);
}

/* Animations */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

@keyframes progressBar {
    from {
        width: 100%;
    }
    to {
        width: 0%;
    }
}
