/* =============================================
   ROMTECH PROFESSIONAL THEME - ITSolutions
   ============================================= */

/* Typography & Base Styles */
html {
    font-size: 14px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    scroll-behavior: smooth;
    height: 100%;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    background-attachment: fixed;
    color: #333;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    position: relative;
    padding-bottom: 120px; /* Footer height */
}

/* Color Palette */
:root {
    --primary-color: #0a7b9d;
    --primary-hover: #085b71;
    --secondary-color: #07afd0;
    --secondary-hover: #05819a;
    --accent-color: #2db6c7;
    --success-color: #43a047;
    --warning-color: #ffb300;
    --danger-color: #e53935;
    --light-bg: #f8f9fa;
    --dark-text: #2c3e50;
    --muted-text: #6c757d;
    --border-color: #e9ecef;
    --shadow-light: rgba(0, 0, 0, 0.1);
    --shadow-medium: rgba(0, 0, 0, 0.15);
    --shadow-heavy: rgba(0, 0, 0, 0.3);
}

/* Focus States */
.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem var(--accent-color);
}

/* =============================================
   LAYOUT & STRUCTURE
   ============================================= */

main {
    padding-top: 80px;
}

.main-content {
    padding-top: 2rem;
    padding-bottom: 2rem;
}

.container {
    max-width: 1200px;
}

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

.navbar {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%) !important;
    box-shadow: 0 2px 20px var(--shadow-light);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--primary-color) !important;
    text-decoration: none;
    transition: all 0.3s ease;
}

.navbar-brand:hover {
    color: var(--primary-hover) !important;
    transform: scale(1.05);
}

.navbar-brand i {
    font-size: 1.8rem;
    margin-right: 0.5rem;
    color: var(--accent-color);
}

.nav-link {
    font-weight: 500;
    color: var(--dark-text) !important;
    transition: all 0.3s ease;
    position: relative;
    padding: 0.5rem 1rem !important;
}

.nav-link:hover {
    color: var(--primary-color) !important;
    transform: translateY(-1px);
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 50%;
    background: var(--primary-color);
    transition: all 0.3s ease;
}

.nav-link:hover::after {
    width: 80%;
    left: 10%;
}

/* =============================================
   CARDS & CONTAINERS
   ============================================= */

.card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 5px 20px var(--shadow-light);
    transition: all 0.3s ease;
    overflow: hidden;
    background: white;
    height: 100%;
}

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

.card-body {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.card-title {
    color: var(--dark-text);
    font-weight: 600;
    margin-bottom: 1rem;
}

.card-text {
    color: var(--muted-text);
    line-height: 1.5;
    flex-grow: 1;
}

/* Ensure equal height for app cards */
.card {
    background: white;
    border-radius: 20px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 10px 30px var(--shadow-light);
    border: 1px solid var(--border-color);
    height: 100%;
    display: flex;
    flex-direction: column;
    min-height: 300px;
    position: relative;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 50px var(--shadow-medium);
}

.card::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 ease;
}

.card:hover::before {
    left: 100%;
}

.card-body {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    height: 100%;
    z-index: 1;
    position: relative;
}

.card-title {
    color: var(--dark-text);
    font-weight: 600;
    margin-bottom: 1rem;
}

.card-text {
    color: var(--muted-text);
    line-height: 1.5;
    flex-grow: 1;
}

.app-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    background: linear-gradient(45deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
}

.app-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--dark-text);
    margin-bottom: 1rem;
}

.app-description {
    color: var(--muted-text);
    margin-bottom: 2rem;
    line-height: 1.5;
    flex-grow: 1;
}

/* =============================================
   BUTTONS
   ============================================= */

.btn {
    border-radius: 50px;
    font-weight: 500;
    padding: 0.75rem 2rem;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.9rem;
}

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

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--shadow-medium);
    background: linear-gradient(45deg, var(--primary-hover), var(--accent-color));
}

.btn-secondary {
    background: linear-gradient(45deg, var(--secondary-color), var(--accent-color));
    border: none;
    color: white;
}

.btn-secondary:hover {
    background: linear-gradient(45deg, var(--secondary-hover), var(--accent-color));
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--shadow-medium);
}

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

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--shadow-medium);
}

/* =============================================
   PORTAL SPECIFIC STYLES
   ============================================= */

.portal-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    padding: 6rem 0 4rem;
    position: relative;
    overflow: hidden;
    margin-top: -80px;
    padding-top: 160px;
}

.portal-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(to bottom, transparent, rgba(0,0,0,0.1));
    pointer-events: none;
}

.portal-header h1 {
    color: white;
    font-weight: 700;
    text-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.portal-header .lead {
    color: rgba(255,255,255,0.9);
    font-size: 1.2rem;
    text-shadow: 0 1px 5px rgba(0,0,0,0.1);
}

/* =============================================
   ANIMATIONS & EFFECTS
   ============================================= */

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

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.pulse {
    animation: pulse 2s infinite;
}

/* =============================================
   LOADING STATES
   ============================================= */

.loading-spinner {
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

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

#loading-indicator {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(248, 249, 250, 0.95));
    backdrop-filter: blur(10px);
    z-index: 9999;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-content {
    background: white;
    padding: 3rem;
    border-radius: 20px;
    box-shadow: 0 20px 60px var(--shadow-medium);
    text-align: center;
    border: 1px solid var(--border-color);
}

.loading-content h3 {
    color: var(--dark-text);
    margin-top: 1rem;
    font-weight: 600;
}

.loading-content p {
    color: var(--muted-text);
    margin-bottom: 0;
}

/* =============================================
   FOOTER
   ============================================= */

.footer {
    background: linear-gradient(135deg, var(--dark-text) 0%, #34495e 100%);
    color: white;
    padding: 2rem 0;
    text-align: center;
    box-shadow: 0 -4px 20px var(--shadow-light);
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 120px;
}

.footer p {
    margin: 0;
    opacity: 0.9;
    font-size: 0.95rem;
}

.footer i {
    opacity: 0.8;
}

/* =============================================
   RESPONSIVE DESIGN
   ============================================= */

@media (max-width: 768px) {
    .portal-header {
        padding: 2rem 0;
    }
    
    .portal-header h1 {
        font-size: 2.5rem;
    }
    
    .portal-header p {
        font-size: 1rem;
    }
    
    .app-card {
        margin-bottom: 2rem;
        min-height: 250px;
    }
    
    .btn {
        padding: 0.5rem 1.5rem;
        font-size: 0.8rem;
    }
    
    main {
        padding-top: 70px;
    }
    
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    body {
        padding-bottom: 100px;
    }
    
    .footer {
        height: 100px;
    }
}

@media (max-width: 576px) {
    .portal-header {
        padding: 1.5rem 0;
    }
    
    .portal-header h1 {
        font-size: 2rem;
    }
    
    .app-icon {
        font-size: 3rem;
    }
    
    .app-title {
        font-size: 1.2rem;
    }
    
    .navbar-brand span {
        font-size: 1.2rem;
    }
    
    .navbar-brand small {
        font-size: 0.6rem !important;
    }
    
    .app-card {
        min-height: 220px;
    }
}

/* =============================================
   UTILITY CLASSES
   ============================================= */

.text-primary { color: var(--primary-color) !important; }
.text-secondary { color: var(--secondary-color) !important; }
.text-info { color: var(--accent-color) !important; }
.text-success { color: var(--success-color) !important; }
.text-warning { color: var(--warning-color) !important; }
.text-danger { color: var(--danger-color) !important; }

.bg-primary { background-color: var(--primary-color) !important; }
.bg-secondary { background-color: var(--secondary-color) !important; }
.bg-info { background-color: var(--accent-color) !important; }
.bg-success { background-color: var(--success-color) !important; }
.bg-warning { background-color: var(--warning-color) !important; }
.bg-danger { background-color: var(--danger-color) !important; }

.shadow-custom {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1) !important;
}

.rounded-custom {
    border-radius: 15px;
}

.gradient-bg {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
}

.fade-transition {
    transition: opacity 0.3s ease-in-out;
}

/* Stats Cards */
.stats-card {
    transition: all 0.3s ease;
    border: 1px solid rgba(0,0,0,0.05);
}

.stats-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.1) !important;
}

.stats-icon {
    width: 50px;
    height: 50px;
    font-size: 1.3rem;
    transition: all 0.3s ease;
}

.stats-card:hover .stats-icon {
    transform: scale(1.1);
}

.stats-card h4 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--dark-text);
}

.stats-card .small {
    font-size: 0.875rem;
    font-weight: 500;
}

/* Small Stats Cards - NO HOVER */
.stats-card-small {
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 20px var(--shadow-light);
    border: 1px solid var(--border-color);
    height: 100%;
    display: flex;
    flex-direction: column;
    min-height: 120px; /* Much smaller than app cards */
    padding: 0.5rem;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.stats-card-small:hover {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-color: var(--primary-color);
}

.stats-card-small .card-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100px;
}

.stats-card-small h5 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.stats-card-small .small {
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Portal Header Icon Enhancement */
.portal-header .bg-white.bg-opacity-20 {
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255,255,255,0.3);
    transition: all 0.3s ease;
}

.portal-header .bg-white.bg-opacity-20:hover {
    background-color: rgba(255,255,255,0.3) !important;
    transform: scale(1.05);
}

/* Stats Cards Small */
.stats-card-small {
    min-height: 120px;
}

.stats-card-small .card-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Typography - Consistent Headers */
h2.fw-bold {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark-text);
    margin-bottom: 1rem;
}

h2.fw-bold i {
    color: var(--primary-color);
}

/* Hero Circle Animation */
.hero-circle {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0.1) 100%);
    border: 3px solid rgba(255,255,255,0.3);
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}

.hero-circle::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
    animation: rotate 3s linear infinite;
}

.hero-circle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 60%;
    height: 60%;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.section-header {
    padding-top: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.icon-circle {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 0 4px 12px var(--shadow-light);
}

.loading-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.7);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

/* Enhanced Pulse Animation */
.pulse {
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Responsive Circle */
@media (max-width: 768px) {
    .hero-circle {
        width: 150px;
        height: 150px;
    }
}

@media (max-width: 576px) {
    .hero-circle {
        width: 120px;
        height: 120px;
    }
}
