/*------------------------------------------------------------------
[DARK THEME]
Dark theme styles for RAMAD website
------------------------------------------------------------------*/

/* Variables CSS para el tema dark */
:root.dark-theme {
  --bg-primary: #2c2c2c;
  --bg-secondary: #3a3a3a;
  --bg-tertiary: #4a4a4a;
  --text-primary: #ffffff;
  --text-secondary: #cccccc;
  --text-muted: #999999;
  --accent-primary: #c0a51e;
  --accent-secondary: #2c3e50;
  --border-color: #555555;
  --shadow-color: rgba(0, 0, 0, 0.5);
}

/* Transiciones suaves para el cambio de tema */
.theme-transition,
.theme-transition *,
.theme-transition *:before,
.theme-transition *:after {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease !important;
}

/* Aplicar tema dark cuando la clase está presente */
.dark-theme {
  background-color: var(--bg-primary) !important;
  color: var(--text-primary) !important;
}

.dark-theme body {
  background-color: var(--bg-primary) !important;
  color: var(--text-primary) !important;
}

/* Backgrounds */
.dark-theme .background-100-e,
.dark-theme .bg {
  background-color: var(--bg-primary) !important;
}

.dark-theme .background-95-e {
  background-color: var(--bg-secondary) !important;
}

.dark-theme .background-90-e {
  background-color: var(--bg-tertiary) !important;
}

/* Todas las variantes de background-e */
.dark-theme .background-5-e {
  background-color: rgba(44, 44, 44, 0.05) !important;
}

.dark-theme .background-10-e {
  background-color: rgba(44, 44, 44, 0.1) !important;
}

.dark-theme .background-15-e {
  background-color: rgba(44, 44, 44, 0.15) !important;
}

.dark-theme .background-20-e {
  background-color: rgba(44, 44, 44, 0.2) !important;
}

.dark-theme .background-25-e {
  background-color: rgba(44, 44, 44, 0.25) !important;
}

.dark-theme .background-30-e {
  background-color: rgba(44, 44, 44, 0.3) !important;
}

.dark-theme .background-35-e {
  background-color: rgba(44, 44, 44, 0.35) !important;
}

.dark-theme .background-40-e {
  background-color: rgba(44, 44, 44, 0.4) !important;
}

.dark-theme .background-45-e {
  background-color: rgba(44, 44, 44, 0.45) !important;
}

.dark-theme .background-50-e {
  background-color: rgba(44, 44, 44, 0.5) !important;
}

.dark-theme .background-55-e {
  background-color: rgba(44, 44, 44, 0.55) !important;
}

.dark-theme .background-60-e {
  background-color: rgba(44, 44, 44, 0.6) !important;
}

.dark-theme .background-65-e {
  background-color: rgba(44, 44, 44, 0.65) !important;
}

.dark-theme .background-70-e {
  background-color: rgba(44, 44, 44, 0.7) !important;
}

.dark-theme .background-75-e {
  background-color: rgba(44, 44, 44, 0.75) !important;
}

.dark-theme .background-80-e {
  background-color: rgba(44, 44, 44, 0.8) !important;
}

.dark-theme .background-85-e {
  background-color: rgba(44, 44, 44, 0.85) !important;
}

.dark-theme .background-e {
  background-color: rgba(44, 44, 44, 0.93) !important;
}

.dark-theme .background-lite-e {
  background-color: rgba(44, 44, 44, 0.53) !important;
}

.dark-theme .background-lite-lite-e {
  background-color: rgba(44, 44, 44, 0.26) !important;
}

.dark-theme .background-hard-e {
  background-color: rgba(44, 44, 44, 0.97) !important;
}

.dark-theme .background-hard-hard-e {
  background-color: rgba(44, 44, 44, 0.98) !important;
}

/* Text colors */
.dark-theme h1,
.dark-theme h2,
.dark-theme h3,
.dark-theme h4,
.dark-theme h5,
.dark-theme h6 {
  color: var(--text-primary) !important;
}

.dark-theme p,
.dark-theme span,
.dark-theme div {
  color: var(--text-secondary) !important;
}

.dark-theme .text-muted,
.dark-theme .muted {
  color: var(--text-muted) !important;
}

/* Navigation */
.dark-theme #top-nav {
  background-color: var(--bg-secondary) !important;
  border-bottom: 1px solid var(--border-color) !important;
}

.dark-theme .navbar-nav > li > a {
  color: var(--text-primary) !important;
  background-color: transparent !important;
}

.dark-theme .navbar-nav > li > a:hover,
.dark-theme .navbar-nav > li > a:focus,
.dark-theme .navbar-nav > li > a:active,
.dark-theme .navbar-nav > li > a.active {
  color: var(--accent-primary) !important;
  background-color: transparent !important;
  background: none !important;
}

.dark-theme .navbar-nav > li:hover > a,
.dark-theme .navbar-nav > li:focus > a,
.dark-theme .navbar-nav > li:active > a {
  color: var(--accent-primary) !important;
  background-color: transparent !important;
  background: none !important;
}

.dark-theme .navbar-brand {
  color: var(--text-primary) !important;
}

.dark-theme .navbar-default {
  background-color: var(--bg-secondary) !important;
  border-color: var(--border-color) !important;
}

.dark-theme .navbar-default .navbar-toggle {
  border-color: var(--border-color) !important;
}

.dark-theme .navbar-default .navbar-toggle .icon-bar {
  background-color: var(--text-primary) !important;
}

.dark-theme .navbar-default .navbar-toggle:hover,
.dark-theme .navbar-default .navbar-toggle:focus {
  background-color: transparent !important;
}

/* Sections */
.dark-theme section {
  background-color: var(--bg-primary) !important;
}

.dark-theme .view {
  background-color: var(--bg-primary) !important;
}

.dark-theme .content {
  background-color: transparent !important;
}

/* Cards and panels */
.dark-theme .panel,
.dark-theme .card {
  background-color: var(--bg-secondary) !important;
  border: 1px solid var(--border-color) !important;
  color: var(--text-primary) !important;
}

.dark-theme .panel-heading,
.dark-theme .card-header {
  background-color: var(--bg-tertiary) !important;
  border-bottom: 1px solid var(--border-color) !important;
  color: var(--text-primary) !important;
}

/* Buttons */
.dark-theme .btn {
  background-color: var(--bg-secondary) !important;
  border: 1px solid var(--border-color) !important;
  color: var(--text-primary) !important;
}

.dark-theme .btn:hover {
  background-color: var(--bg-tertiary) !important;
  color: var(--accent-primary) !important;
}

.dark-theme .btn-primary {
  background-color: var(--accent-primary) !important;
  border-color: var(--accent-primary) !important;
  color: #ffffff !important;
}

.dark-theme .btn-primary:hover {
  background-color: #2980b9 !important;
  border-color: #2980b9 !important;
}

/* Forms */
.dark-theme input,
.dark-theme textarea,
.dark-theme select {
  background-color: var(--bg-secondary) !important;
  border: 1px solid var(--border-color) !important;
  color: var(--text-primary) !important;
}

.dark-theme input:focus,
.dark-theme textarea:focus,
.dark-theme select:focus {
  background-color: var(--bg-tertiary) !important;
  border-color: var(--accent-primary) !important;
  box-shadow: 0 0 5px rgba(52, 152, 219, 0.3) !important;
}

.dark-theme .form-control {
  background-color: var(--bg-secondary) !important;
  border: 1px solid var(--border-color) !important;
  color: var(--text-primary) !important;
}

/* Team section specific */
.dark-theme .team-member {
  background-color: var(--bg-secondary) !important;
  border: 1px solid var(--border-color) !important;
}

.dark-theme .caption {
  background-color: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
}

.dark-theme .highlight {
  color: var(--accent-primary) !important;
}

/* Footer */
.dark-theme footer {
  background-color: var(--bg-secondary) !important;
  border-top: 1px solid var(--border-color) !important;
  color: var(--text-secondary) !important;
}

/* Shadows and borders */
.dark-theme .shadow,
.dark-theme .box-shadow {
  box-shadow: 0 2px 10px var(--shadow-color) !important;
}

.dark-theme .border {
  border-color: var(--border-color) !important;
}

/* Border variants */
.dark-theme .border-background-e {
  border-color: rgba(44, 44, 44, 0.7) !important;
}

.dark-theme .border-text-e {
  border-color: rgba(204, 204, 204, 0.7) !important;
}

.dark-theme .border-highlight-e {
  border-color: rgba(192, 165, 30, 0.7) !important;
}

.dark-theme .border-heading-e {
  border-color: rgba(52, 152, 219, 0.7) !important;
}

.dark-theme .border-link-e {
  border-color: rgba(52, 152, 219, 0.7) !important;
}

/* Links */
.dark-theme a {
  color: var(--accent-primary) !important;
}

.dark-theme a:hover {
  color: #2980b9 !important;
}

/* Page borders (franjas laterales) */
.dark-theme .page-border {
  background-color: var(--bg-primary) !important;
  border-color: var(--border-color) !important;
}

.dark-theme .page-border.left {
  background-color: var(--bg-primary) !important;
  border-right-color: var(--border-color) !important;
}

.dark-theme .page-border.right {
  background-color: var(--bg-primary) !important;
  border-left-color: var(--border-color) !important;
}

.dark-theme .page-border.bottom {
  background-color: var(--bg-primary) !important;
  border-top-color: var(--border-color) !important;
  color: var(--text-primary) !important;
}

.dark-theme .page-border.bottom a {
  color: var(--text-primary) !important;
}

.dark-theme .page-border.bottom a:hover {
  color: var(--accent-primary) !important;
}

/* Logo - Mejorar visibilidad en tema dark */
.dark-theme .navbar-brand img {
  filter: brightness(1.7) contrast(1.1) !important;
  background-color: rgba(255, 255, 255, 0.1) !important;
  border-radius: 8px !important;
  padding: 4px 8px !important;
}

/* Sección contacto - Mejorar legibilidad */
.dark-theme #contact .view {
  position: relative;
}

.dark-theme #contact .view::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6) !important;
  z-index: 1;
}

.dark-theme #contact .content {
  position: relative;
  z-index: 2;
}

.dark-theme .colors-h {
  color: var(--text-primary) !important;
  background-color: rgba(44, 44, 44, 0.85) !important;
}

.dark-theme .colors-h .heading,
.dark-theme .colors-h.heading {
  color: var(--text-primary) !important;
}

.dark-theme .colors-h .highlight,
.dark-theme .colors-h.highlight {
  color: var(--accent-primary) !important;
}

.dark-theme .colors-h a,
.dark-theme a.colors-h {
  color: var(--accent-primary) !important;
}

.dark-theme .colors-h a:hover {
  color: #2980b9 !important;
}

/* Scrollbar for webkit browsers */
.dark-theme ::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.dark-theme ::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

.dark-theme ::-webkit-scrollbar-thumb {
  background: var(--bg-tertiary);
  border-radius: 4px;
}

.dark-theme ::-webkit-scrollbar-thumb:hover {
  background: var(--border-color);
}

/* Images - aplicar filtro oscuro para mejor contraste */
.dark-theme img {
  filter: brightness(0.9) contrast(1.1);
}

.dark-theme .team-member img {
  filter: brightness(0.95) contrast(1.05);
}

/* Transiciones suaves para el cambio de tema */
.theme-transition,
.theme-transition *,
.theme-transition *:before,
.theme-transition *:after {
  transition: background-color 0.3s ease, 
              color 0.3s ease, 
              border-color 0.3s ease,
              box-shadow 0.3s ease !important;
}

/* Forms mejoradas */
.dark-theme input,
.dark-theme textarea,
.dark-theme select {
  background-color: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
  border-color: var(--border-color) !important;
}

.dark-theme input:focus,
.dark-theme textarea:focus,
.dark-theme select:focus {
  background-color: var(--bg-tertiary) !important;
  border-color: var(--accent-primary) !important;
  box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25) !important;
}

.dark-theme .form-control {
  background-color: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
  border-color: var(--border-color) !important;
}

.dark-theme .form-control:focus {
  background-color: var(--bg-terciary) !important;
  border-color: var(--accent-primary) !important;
  box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25) !important;
}

/* Mejorar botones */
.dark-theme .btn-default {
  background-color: var(--bg-terciary) !important;
  border-color: var(--border-color) !important;
  color: var(--text-primary) !important;
}

.dark-theme .btn-default:hover {
  background-color: var(--accent-primary) !important;
  border-color: var(--accent-primary) !important;
  color: white !important;
}

.dark-theme .btn-primary {
  background-color: var(--accent-primary) !important;
  border-color: var(--accent-primary) !important;
}

.dark-theme .btn-primary:hover {
  background-color: #2980b9 !important;
  border-color: #2980b9 !important;
}

/* Mejorar tablas */
.dark-theme table {
  background-color: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
}

.dark-theme table th,
.dark-theme table td {
  border-color: var(--border-color) !important;
  color: var(--text-primary) !important;
}

.dark-theme table thead th {
  background-color: var(--bg-terciary) !important;
  color: var(--text-primary) !important;
}

.dark-theme table tbody tr:nth-child(even) {
  background-color: rgba(255, 255, 255, 0.05) !important;
}

.dark-theme table tbody tr:hover {
  background-color: rgba(52, 152, 219, 0.1) !important;
}

/* Sección Clientes - Mejorar legibilidad en tema dark */
.dark-theme #clients .client-card {
  background: rgba(58, 58, 58, 0.95) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5) !important;
}

.dark-theme #clients .client-card:hover {
  background: rgba(74, 74, 74, 1) !important;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6) !important;
  transform: translateY(-5px) !important;
}

.dark-theme #clients .client-card a {
  color: #ffffff !important;
}

.dark-theme #clients .client-card:hover a {
  color: #c0a51e !important;
}

.dark-theme #clients .client-card .client-logo {
  background: #e8f4fd !important;
  border: 3px solid #c0a51e !important;
}

.dark-theme #clients .client-card div[style*="font-size: 18px"] {
  color: #ffffff !important;
}

.dark-theme #clients .client-card div[style*="font-size: 13px"] {
  color: #cccccc !important;
}

/* Asegurar que el título y subtítulo de la sección clientes sean visibles */
.dark-theme #clients h2 {
  color: var(--text-primary) !important;
}

.dark-theme #clients .header-details {
  color: var(--text-secondary) !important;
}

.dark-theme #clients .header-details .highlight {
  color: var(--accent-primary) !important;
}
