/* RegardingWork Display System - Global Styles */

:root {
    --primary-color: #007bff;
    --primary-dark: #0056b3;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --border-radius: 0.375rem;
    --box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --box-shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
    --transition: all 0.3s ease;
}

/* Global Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    padding: 80px 0;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.1;
}

.hero-section .container {
    position: relative;
    z-index: 1;
}

.hero-section .btn {
    border-radius: 50px;
    padding: 12px 30px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: var(--transition);
}

.hero-section .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

/* Feature Grid */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 40px;
}

.feature-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    padding: 25px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.15);
}

.feature-card i {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: #fff;
}

.feature-card h5 {
    margin-bottom: 10px;
    font-weight: 600;
}

.feature-card p {
    margin: 0;
    opacity: 0.9;
    font-size: 0.9rem;
}

/* Device Icons */
.device-icon {
    text-align: center;
    padding: 20px;
    border-radius: var(--border-radius);
    background: white;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

.device-icon:hover {
    transform: translateY(-3px);
    box-shadow: var(--box-shadow-lg);
}

.device-icon i {
    color: var(--primary-color);
    margin-bottom: 10px;
}

.device-icon p {
    margin: 0;
    font-weight: 600;
    color: var(--dark-color);
}

/* Cards */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

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

.card-header {
    background: linear-gradient(45deg, var(--primary-color), var(--primary-dark));
    color: white;
    border-bottom: none;
    border-radius: var(--border-radius) var(--border-radius) 0 0 !important;
}

.card-header h4,
.card-header h5,
.card-header h6 {
    margin: 0;
}

/* Device Cards */
.device-card {
    transition: var(--transition);
    height: 100%;
}

.device-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.device-card .card-header {
    background: linear-gradient(45deg, #28a745, #20c997);
}

.device-card .badge {
    font-size: 0.75rem;
    padding: 0.4em 0.6em;
}

/* Forms */
.form-control {
    border-radius: var(--border-radius);
    border: 1px solid #ced4da;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.input-group-text {
    background: var(--light-color);
    border: 1px solid #ced4da;
    border-radius: var(--border-radius);
}

.btn {
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: var(--transition);
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: linear-gradient(45deg, var(--primary-color), var(--primary-dark));
    border: none;
}

.btn-success {
    background: linear-gradient(45deg, var(--success-color), #20c997);
    border: none;
}

.btn-danger {
    background: linear-gradient(45deg, var(--danger-color), #e74c3c);
    border: none;
}

/* Widget Configuration Styles */
.widget-palette {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.widget-item {
    display: flex;
    align-items: center;
    padding: 12px;
    background: var(--light-color);
    border: 2px solid transparent;
    border-radius: var(--border-radius);
    cursor: grab;
    transition: var(--transition);
    user-select: none;
}

.widget-item:hover {
    background: var(--primary-color);
    color: white;
    transform: translateX(5px);
}

.widget-item:active {
    cursor: grabbing;
}

.widget-item i {
    margin-right: 10px;
    font-size: 1.2rem;
    width: 20px;
    text-align: center;
}

.widget-item span {
    font-weight: 500;
}

/* Canvas */
.device-canvas {
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: var(--border-radius);
    position: relative;
    overflow: hidden;
}

.device-canvas.dragover {
    border-color: var(--primary-color);
    background: rgba(0, 123, 255, 0.05);
}

.widget-on-canvas {
    border: 2px solid var(--primary-color);
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--border-radius);
    cursor: move;
    transition: var(--transition);
    user-select: none;
}

.widget-on-canvas:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.widget-on-canvas.selected {
    border-color: var(--success-color);
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.25);
}

.widget-on-canvas .widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 8px;
    background: rgba(0, 123, 255, 0.1);
    border-bottom: 1px solid rgba(0, 123, 255, 0.2);
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.widget-on-canvas .widget-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary-color);
    text-transform: uppercase;
    margin: 0;
}

.widget-on-canvas .widget-close {
    border: none;
    background: none;
    color: var(--danger-color);
    cursor: pointer;
    font-size: 1rem;
    padding: 0;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.widget-on-canvas .widget-content {
    padding: 8px;
    font-size: 0.8rem;
    color: #666;
    overflow: hidden;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .hero-section {
        padding: 60px 0;
    }
    
    .hero-section .display-4 {
        font-size: 2rem;
    }
    
    .feature-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .device-canvas {
        height: 400px !important;
    }
    
    .col-md-3,
    .col-md-6,
    .col-md-9 {
        margin-bottom: 20px;
    }
}

@media (max-width: 576px) {
    .container-fluid {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    .card {
        margin-bottom: 15px;
    }
    
    .btn {
        font-size: 0.875rem;
        padding: 8px 16px;
    }
    
    .hero-section .btn {
        display: block;
        margin-bottom: 10px;
    }
}

/* Loading states */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Alerts */
.alert {
    border: none;
    border-radius: var(--border-radius);
    border-left: 4px solid;
}

.alert-success {
    border-left-color: var(--success-color);
    background: rgba(40, 167, 69, 0.1);
    color: #155724;
}

.alert-danger {
    border-left-color: var(--danger-color);
    background: rgba(220, 53, 69, 0.1);
    color: #721c24;
}

.alert-warning {
    border-left-color: var(--warning-color);
    background: rgba(255, 193, 7, 0.1);
    color: #856404;
}

.alert-info {
    border-left-color: var(--info-color);
    background: rgba(23, 162, 184, 0.1);
    color: #0c5460;
}

/* Progress bars */
.progress {
    border-radius: var(--border-radius);
    overflow: hidden;
}

.progress-bar {
    transition: width 0.6s ease;
}

/* Dropdown menus */
.dropdown-menu {
    border: none;
    box-shadow: var(--box-shadow-lg);
    border-radius: var(--border-radius);
}

.dropdown-item {
    transition: var(--transition);
}

.dropdown-item:hover {
    background: var(--primary-color);
    color: white;
}

/* Navigation */
.navbar-brand {
    font-weight: 700;
    font-size: 1.25rem;
}

.navbar-brand i {
    margin-right: 8px;
}

/* Footer */
footer {
    margin-top: auto;
}

footer a {
    text-decoration: none;
    transition: var(--transition);
}

footer a:hover {
    color: white !important;
}

/* Utility classes */
.text-shadow {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.border-gradient {
    border: 2px solid;
    border-image: linear-gradient(45deg, var(--primary-color), var(--success-color)) 1;
}

.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
}

.bg-gradient-success {
    background: linear-gradient(135deg, var(--success-color), #20c997);
}

/* Animation utilities */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-in-left {
    animation: slideInLeft 0.5s ease-out;
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

.slide-in-right {
    animation: slideInRight 0.5s ease-out;
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
