/* 
 * Enhanced CSS for DigClock.com
 * Improved visual identity and user experience
 */

/* Base styles and variables */
:root {
  --primary-color: #3498db;
  --secondary-color: #2980b9;
  --accent-color: #9b59b6;
  --text-color: #333;
  --text-color-light: #666;
  --background-color: #f8f9fa;
  --card-bg-color: #fff;
  --border-color: #e0e0e0;
  --success-color: #2ecc71;
  --warning-color: #f39c12;
  --danger-color: #e74c3c;
  --shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s ease;
  
  /* Dark mode variables */
  --dark-bg: #222;
  --dark-card-bg: #333;
  --dark-text: #f0f0f0;
  --dark-text-secondary: #ccc;
  --dark-border: #444;
}

body {
  font-family: 'Roboto', 'Segoe UI', Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--background-color);
  transition: var(--transition);
  margin: 0;
  padding: 0;
}

/* Dark mode styles */
body.dark-mode {
  --text-color: var(--dark-text);
  --text-color-light: var(--dark-text-secondary);
  --background-color: var(--dark-bg);
  --card-bg-color: var(--dark-card-bg);
  --border-color: var(--dark-border);
}

/* Typography improvements */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  margin-top: 1.5rem;
  margin-bottom: 1rem;
  color: var(--primary-color);
}

h1 {
  font-size: 2.5rem;
  margin-top: 0;
}

h2 {
  font-size: 2rem;
  border-bottom: 2px solid var(--primary-color);
  padding-bottom: 0.5rem;
  margin-top: 2rem;
}

h3 {
  font-size: 1.5rem;
  color: var(--secondary-color);
}

p {
  margin-bottom: 1.2rem;
  font-size: 1.05rem;
}

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

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

/* Enhanced Header */
.site-header {
  background-color: var(--primary-color);
  color: white;
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.site-title {
  font-size: 1.5rem;
  font-weight: bold;
  display: flex;
  align-items: center;
}

.site-title img {
  height: 40px;
  margin-right: 10px;
}

.site-title a {
  color: white;
  text-decoration: none;
}

.top-nav {
  display: flex;
  align-items: center;
}

.top-nav .btn {
  margin-left: 0.5rem;
}

/* Improved Sidebar */
.sidebar {
  background-color: var(--card-bg-color);
  border-right: 1px solid var(--border-color);
  padding: 1rem 0;
  width: 220px;
  transition: var(--transition);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
}

.sidebar-nav-item {
  padding: 0.75rem 1.5rem;
  color: var(--text-color);
  text-decoration: none;
  border-left: 4px solid transparent;
  transition: var(--transition);
  font-weight: 500;
}

.sidebar-nav-item:hover {
  background-color: rgba(52, 152, 219, 0.1);
  border-left-color: var(--primary-color);
  text-decoration: none;
}

.sidebar-nav-item.active {
  background-color: rgba(52, 152, 219, 0.2);
  border-left-color: var(--primary-color);
  color: var(--primary-color);
  font-weight: 600;
}

/* Main Container Layout */
.main-container {
  display: flex;
  min-height: calc(100vh - 60px - 60px - 100px); /* Viewport height minus header, footer, and ads */
}

.content-wrapper {
  display: flex;
  flex: 1;
}

.main-content {
  flex: 1;
  padding: 2rem;
  max-width: 100%;
}

/* Ad Containers */
.ad-container {
  background-color: var(--card-bg-color);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 1rem;
  margin: 1rem 0;
  text-align: center;
  overflow: hidden;
  transition: var(--transition);
}

.ad-top, .ad-bottom {
  min-height: 90px;
}

.ad-sidebar {
  width: 300px;
  padding: 1rem;
}

.ad-sidebar .ad-container {
  min-height: 250px;
  margin-bottom: 2rem;
}

/* Enhanced Clock Display */
.clock-display {
  font-size: 5rem;
  font-weight: 700;
  text-align: center;
  margin: 2rem 0;
  padding: 2rem;
  background-color: var(--card-bg-color);
  border-radius: 8px;
  box-shadow: var(--shadow);
  color: var(--primary-color);
  transition: var(--transition);
  user-select: none;
}

.clock-display:hover {
  transform: scale(1.02);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Alarm, Timer, and Stopwatch Controls */
.control-panel {
  background-color: var(--card-bg-color);
  border-radius: 8px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
}

.control-panel .form-group {
  margin-bottom: 1.5rem;
}

.control-panel label {
  font-weight: 500;
  margin-bottom: 0.5rem;
  display: block;
}

.control-panel .btn {
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
  padding: 0.5rem 1.5rem;
  font-weight: 500;
  transition: var(--transition);
}

.control-panel .btn:hover {
  transform: translateY(-2px);
}

/* World Clock Styles */
.world-clock-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.world-clock-item {
  background-color: var(--card-bg-color);
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.world-clock-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.world-clock-city {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--primary-color);
}

.world-clock-time {
  font-size: 2rem;
  font-weight: 700;
}

/* Enhanced Footer */
.site-footer {
  background-color: var(--primary-color);
  color: white;
  text-align: center;
  padding: 1.5rem;
  margin-top: 2rem;
}

/* Card Styles for Articles and Sections */
.card {
  background-color: var(--card-bg-color);
  border-radius: 8px;
  border: 1px solid var(--border-color);
  overflow: hidden;
  transition: var(--transition);
  height: 100%;
}

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

.card-title {
  color: var(--primary-color);
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}

.card-body {
  padding: 1.5rem;
}

/* Article Styling */
.productivity-article, .about-section, .time-fact {
  background-color: var(--card-bg-color);
  border-radius: 8px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
}

.productivity-article img, .about-section img, .time-fact img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  margin-bottom: 1.5rem;
}

/* Related Links Section */
.related-links-section {
  background-color: var(--card-bg-color);
  border-radius: 8px;
  padding: 2rem;
  margin: 2rem 0;
  box-shadow: var(--shadow);
}

/* Breadcrumbs */
.breadcrumb {
  background-color: transparent;
  padding: 0.5rem 0;
}

.breadcrumb-item + .breadcrumb-item::before {
  content: "›";
  color: var(--text-color-light);
}

.breadcrumb-item.active {
  color: var(--primary-color);
  font-weight: 500;
}

/* Responsive Design Improvements */
@media (max-width: 992px) {
  .main-container {
    flex-direction: column;
  }
  
  .sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }
  
  .sidebar-nav {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .sidebar-nav-item {
    padding: 0.5rem 1rem;
    border-left: none;
    border-bottom: 3px solid transparent;
  }
  
  .sidebar-nav-item:hover, .sidebar-nav-item.active {
    border-left-color: transparent;
    border-bottom-color: var(--primary-color);
  }
  
  .content-wrapper {
    flex-direction: column;
  }
  
  .ad-sidebar {
    width: 100%;
    padding: 1rem 2rem;
  }
  
  .clock-display {
    font-size: 3.5rem;
    padding: 1.5rem;
  }
}

@media (max-width: 768px) {
  .site-header {
    flex-direction: column;
    padding: 0.75rem;
  }
  
  .top-nav {
    margin-top: 0.75rem;
  }
  
  .main-content {
    padding: 1rem;
  }
  
  .clock-display {
    font-size: 2.5rem;
    padding: 1rem;
    margin: 1rem 0;
  }
  
  h1 {
    font-size: 2rem;
  }
  
  h2 {
    font-size: 1.75rem;
  }
  
  .control-panel {
    padding: 1.5rem;
  }
}

/* Accessibility Improvements */
.btn:focus, a:focus, input:focus, select:focus {
  outline: 3px solid rgba(52, 152, 219, 0.5);
  outline-offset: 2px;
}

/* Skip to content link for screen readers */
.skip-to-content {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.skip-to-content:focus {
  position: fixed;
  top: 0;
  left: 0;
  width: auto;
  height: auto;
  padding: 0.5rem 1rem;
  background-color: var(--primary-color);
  color: white;
  font-weight: bold;
  z-index: 9999;
}

/* Print styles */
@media print {
  .site-header, .sidebar, .ad-container, .site-footer, .control-panel .btn {
    display: none !important;
  }
  
  .main-container, .content-wrapper, .main-content {
    display: block;
    width: 100%;
    padding: 0;
    margin: 0;
  }
  
  body {
    background-color: white;
    color: black;
  }
  
  a {
    color: black;
    text-decoration: underline;
  }
  
  .clock-display, .world-clock-item, .productivity-article, .about-section {
    box-shadow: none;
    border: 1px solid #ddd;
  }
}

/* Animation for clock digits */
@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.03); }
  100% { transform: scale(1); }
}

.clock-display .seconds {
  animation: pulse 1s infinite;
  display: inline-block;
}

/* Tooltip styles */
.tooltip {
  position: relative;
  display: inline-block;
}

.tooltip .tooltip-text {
  visibility: hidden;
  width: 200px;
  background-color: var(--text-color);
  color: white;
  text-align: center;
  border-radius: 6px;
  padding: 0.5rem;
  position: absolute;
  z-index: 1;
  bottom: 125%;
  left: 50%;
  margin-left: -100px;
  opacity: 0;
  transition: opacity 0.3s;
}

.tooltip:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}

/* Enhanced form controls */
.form-control {
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 0.5rem 0.75rem;
  transition: var(--transition);
}

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

/* Button styles */
.btn-primary {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-primary:hover {
  background-color: var(--secondary-color);
  border-color: var(--secondary-color);
}

.btn-secondary {
  background-color: var(--text-color-light);
  border-color: var(--text-color-light);
}

.btn-danger {
  background-color: var(--danger-color);
  border-color: var(--danger-color);
}

/* Table styles */
.table {
  width: 100%;
  margin-bottom: 1rem;
  color: var(--text-color);
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 0.75rem;
  vertical-align: top;
  border-top: 1px solid var(--border-color);
}

.table thead th {
  vertical-align: bottom;
  border-bottom: 2px solid var(--border-color);
  background-color: rgba(52, 152, 219, 0.1);
}

.table tbody tr:hover {
  background-color: rgba(52, 152, 219, 0.05);
}

/* Code blocks */
pre, code {
  font-family: 'Courier New', Courier, monospace;
  background-color: rgba(0, 0, 0, 0.05);
  border-radius: 3px;
  padding: 0.2rem 0.4rem;
}

pre {
  padding: 1rem;
  overflow-x: auto;
}

/* Blockquote styling */
blockquote {
  border-left: 4px solid var(--primary-color);
  padding-left: 1rem;
  margin-left: 0;
  color: var(--text-color-light);
  font-style: italic;
}

/* List styling */
ul, ol {
  padding-left: 1.5rem;
  margin-bottom: 1.5rem;
}

li {
  margin-bottom: 0.5rem;
}

/* Image styling */
img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

/* Utility classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 3rem; }

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

.lead {
  font-size: 1.25rem;
  font-weight: 300;
}

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

::-webkit-scrollbar-track {
  background: var(--background-color);
}

::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--secondary-color);
}
