/**
 * RSPWorks Nextcloud Custom Branding
 * Server: cloud.rspworks.tech
 * Version: 1.0
 * Date: January 31, 2026
 * 
 * Installation:
 * 1. Upload to Nextcloud themes directory
 * 2. Enable in Nextcloud settings
 * 3. Or inject via Nginx for all users
 */

/* =================================================================
   PRIMARY BRANDING - RSPWorks Color Scheme
   ================================================================= */

:root {
    /* Primary Brand Colors */
    --color-primary: #2563eb;        /* RSPWorks Blue */
    --color-primary-light: #60a5fa;
    --color-primary-dark: #1e40af;
    
    /* Accent Colors */
    --color-accent: #8b5cf6;         /* Purple accent */
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-error: #ef4444;
    
    /* Neutral Colors */
    --color-bg-primary: #ffffff;
    --color-bg-secondary: #f9fafb;
    --color-text-primary: #111827;
    --color-text-secondary: #6b7280;
}

/* Dark mode colors */
[data-theme-dark] {
    --color-bg-primary: #1f2937;
    --color-bg-secondary: #111827;
    --color-text-primary: #f9fafb;
    --color-text-secondary: #9ca3af;
}

/* =================================================================
   HEADER & NAVIGATION BRANDING
   ================================================================= */

/* Main header background */
#header {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%) !important;
    border-bottom: 3px solid var(--color-accent);
}

/* Logo customization */
#nextcloud {
    background-image: url('/themes/custom/logo.svg') !important;
    background-size: contain;
    width: 160px !important;
}

/* Header text color */
#header .header-appname {
    color: #ffffff !important;
    font-weight: 600;
}

/* User menu */
#settings {
    background-color: rgba(255, 255, 255, 0.1) !important;
    border-radius: 8px;
}

#settings:hover {
    background-color: rgba(255, 255, 255, 0.2) !important;
}

/* =================================================================
   LOGIN PAGE BRANDING
   ================================================================= */

/* Login background */
#body-login {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-attachment: fixed;
}

/* Login form container */
#body-login .wrapper {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
}

/* Login form heading */
#body-login h2 {
    color: var(--color-primary);
    font-weight: 700;
}

/* Login button */
#body-login .login-form input[type="submit"] {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
    border: none;
    border-radius: 8px;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
}

#body-login .login-form input[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.4);
}

/* Login footer */
#body-login footer {
    color: rgba(255, 255, 255, 0.9);
}

#body-login footer a {
    color: rgba(255, 255, 255, 1);
    font-weight: 600;
}

/* =================================================================
   SIDEBAR & NAVIGATION
   ================================================================= */

/* App navigation sidebar */
#app-navigation {
    background-color: var(--color-bg-secondary);
    border-right: 1px solid rgba(0, 0, 0, 0.05);
}

/* Navigation items */
#app-navigation li a {
    border-radius: 8px;
    margin: 4px 8px;
    transition: all 0.2s;
}

#app-navigation li a:hover,
#app-navigation li a:focus {
    background-color: var(--color-primary-light);
    color: white;
    transform: translateX(4px);
}

#app-navigation li a.active {
    background-color: var(--color-primary);
    color: white;
    font-weight: 600;
}

/* =================================================================
   BUTTONS & CONTROLS
   ================================================================= */

/* Primary buttons */
.button.primary,
button.primary {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    border: none;
    border-radius: 8px;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
}

.button.primary:hover,
button.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* Secondary buttons */
.button,
button {
    border-radius: 8px;
    transition: all 0.2s;
}

/* =================================================================
   FILE LIST CUSTOMIZATION
   ================================================================= */

/* File row hover effect */
#app-content-files tbody tr:hover {
    background-color: rgba(37, 99, 235, 0.05);
    transition: background-color 0.2s;
}

/* Selected files */
#app-content-files tbody tr.selected {
    background-color: rgba(37, 99, 235, 0.1);
}

/* File actions */
.fileactions {
    border-radius: 6px;
}

/* =================================================================
   CARDS & PANELS
   ================================================================= */

/* Dashboard widgets */
.panel {
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
}

.panel:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

/* =================================================================
   UPLOAD & PROGRESS INDICATORS
   ================================================================= */

/* Upload progress bar */
.uploadprogressbar {
    background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-accent) 100%);
    border-radius: 4px;
    height: 6px;
}

/* Loading spinner */
.icon-loading {
    border-color: var(--color-primary) transparent var(--color-primary) transparent;
}

/* =================================================================
   MOBILE RESPONSIVENESS
   ================================================================= */

@media (max-width: 768px) {
    /* Adjust header for mobile */
    #header {
        padding: 8px 12px;
    }
    
    /* Stack navigation items */
    #app-navigation li a {
        margin: 2px 4px;
        font-size: 14px;
    }
    
    /* Larger touch targets */
    .fileactions a {
        padding: 12px;
    }
}

/* =================================================================
   CUSTOM BRANDING ELEMENTS
   ================================================================= */

/* Add custom footer branding */
#body-user footer::after {
    content: "Powered by RSPWorks Technology";
    display: block;
    text-align: center;
    color: var(--color-text-secondary);
    font-size: 12px;
    margin-top: 8px;
}

/* Custom notification styling */
.toastify {
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.toastify.dialogs.toast-success {
    background: linear-gradient(135deg, var(--color-success) 0%, #059669 100%);
}

.toastify.dialogs.toast-error {
    background: linear-gradient(135deg, var(--color-error) 0%, #dc2626 100%);
}

/* =================================================================
   ACCESSIBILITY IMPROVEMENTS
   ================================================================= */

/* Focus indicators */
a:focus,
button:focus,
input:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* High contrast links */
a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--color-primary-dark);
    text-decoration: underline;
}

/* =================================================================
   ANIMATIONS
   ================================================================= */

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

.panel,
.button,
#app-navigation li a {
    animation: slideIn 0.3s ease-out;
}

/* Smooth transitions for theme switching */
* {
    transition: background-color 0.2s, color 0.2s;
}
