/* ROX Tools Shared Styles */

/* Common variables used across all modules */
:root {
    --rox-primary-color: #ce1620;
    --rox-primary-hover: #b31218;
    --rox-text-color: #000000;
    --rox-background-color: #ffffff;
    --rox-gray-light: #f5f5f5;
    --rox-gray-medium: #e0e0e0;
    --rox-gray-dark: #666666;
    --rox-border-radius: 4px;
    --rox-font-family: 'Raleway', sans-serif;
    --rox-transition: all 0.3s ease;
}

/* Common utility classes */
.rox-tools-hidden {
    display: none !important;
}

.rox-tools-error {
    color: var(--rox-primary-color);
    background: var(--rox-gray-light);
    padding: 1rem;
    border-radius: var(--rox-border-radius);
    border-left: 4px solid var(--rox-primary-color);
    margin: 1rem 0;
}

.rox-tools-success {
    color: #2d5a27;
    background: #d4edda;
    padding: 1rem;
    border-radius: var(--rox-border-radius);
    border-left: 4px solid #28a745;
    margin: 1rem 0;
}

.rox-tools-warning {
    color: #856404;
    background: #fff3cd;
    padding: 1rem;
    border-radius: var(--rox-border-radius);
    border-left: 4px solid #ffc107;
    margin: 1rem 0;
}

/* Common button styles */
.rox-btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--rox-border-radius);
    cursor: pointer;
    font-family: var(--rox-font-family);
    font-weight: 500;
    font-size: 1rem;
    text-decoration: none;
    text-align: center;
    transition: var(--rox-transition);
    vertical-align: middle;
    line-height: 1.2;
}

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

.rox-btn-primary:hover {
    background-color: var(--rox-primary-hover);
    transform: translateY(-1px);
    color: white;
}

.rox-btn-secondary {
    background-color: var(--rox-gray-light);
    color: var(--rox-text-color);
    border: 1px solid var(--rox-gray-medium);
}

.rox-btn-secondary:hover {
    background-color: var(--rox-gray-medium);
    color: var(--rox-text-color);
}

.rox-btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.rox-btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

/* Common form styles */
.rox-form-group {
    margin-bottom: 1.5rem;
}

.rox-form-label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--rox-text-color);
}

.rox-form-input,
.rox-form-select,
.rox-form-textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--rox-gray-medium);
    border-radius: var(--rox-border-radius);
    font-family: var(--rox-font-family);
    font-size: 1rem;
    transition: var(--rox-transition);
}

.rox-form-input:focus,
.rox-form-select:focus,
.rox-form-textarea:focus {
    outline: none;
    border-color: var(--rox-primary-color);
    box-shadow: 0 0 0 2px rgba(206, 22, 32, 0.1);
}

/* Common modal styles */
.rox-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.rox-modal-content {
    background-color: var(--rox-background-color);
    margin: 5% auto;
    padding: 2rem;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.rox-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    color: var(--rox-gray-dark);
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--rox-transition);
}

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

/* Common loading states */
.rox-loading {
    position: relative;
    opacity: 0.6;
    pointer-events: none;
}

.rox-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--rox-gray-medium);
    border-top-color: var(--rox-primary-color);
    border-radius: 50%;
    animation: rox-spin 0.8s linear infinite;
}

@keyframes rox-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Common grid utilities */
.rox-grid {
    display: grid;
    gap: 1rem;
}

.rox-grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.rox-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.rox-grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

.rox-grid-auto {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* Common flex utilities */
.rox-flex {
    display: flex;
}

.rox-flex-center {
    justify-content: center;
    align-items: center;
}

.rox-flex-between {
    justify-content: space-between;
    align-items: center;
}

.rox-flex-wrap {
    flex-wrap: wrap;
}

.rox-flex-gap {
    gap: 1rem;
}

/* Common spacing utilities */
.rox-mt-1 { margin-top: 0.5rem; }
.rox-mt-2 { margin-top: 1rem; }
.rox-mt-3 { margin-top: 1.5rem; }
.rox-mt-4 { margin-top: 2rem; }

.rox-mb-1 { margin-bottom: 0.5rem; }
.rox-mb-2 { margin-bottom: 1rem; }
.rox-mb-3 { margin-bottom: 1.5rem; }
.rox-mb-4 { margin-bottom: 2rem; }

.rox-p-1 { padding: 0.5rem; }
.rox-p-2 { padding: 1rem; }
.rox-p-3 { padding: 1.5rem; }
.rox-p-4 { padding: 2rem; }

/* Responsive utilities */
@media (max-width: 768px) {
    .rox-grid-2,
    .rox-grid-3,
    .rox-grid-4 {
        grid-template-columns: 1fr;
    }
    
    .rox-modal-content {
        margin: 10% auto;
        width: 95%;
        padding: 1.5rem;
    }
    
    .rox-flex-mobile-column {
        flex-direction: column;
    }
}

/* Typography */
.rox-text-center { text-align: center; }
.rox-text-left { text-align: left; }
.rox-text-right { text-align: right; }

.rox-font-bold { font-weight: bold; }
.rox-font-medium { font-weight: 500; }

.rox-text-primary { color: var(--rox-primary-color); }
.rox-text-muted { color: var(--rox-gray-dark); }

/* Common card styles */
.rox-card {
    background: var(--rox-background-color);
    border: 1px solid var(--rox-gray-medium);
    border-radius: var(--rox-border-radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.rox-card-header {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--rox-gray-light);
}

.rox-card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--rox-primary-color);
    margin: 0;
}