/**
 * Interactive Content Elements - Global Styles
 * Version: 2.0
 */

/* --------------------------------
 * 1. CSS Reset & Variables
 * -------------------------------- */
:root {
  --ice-primary: #4a6ee0;
  --ice-success: #28a745;
  --ice-danger: #dc3545;
  --ice-warning: #ffc107;
  --ice-info: #17a2b8;
  --ice-light: #f8f9fa;
  --ice-dark: #343a40;
  --ice-gray: #6c757d;
  --ice-border: #dee2e6;
  --ice-shadow: rgba(0, 0, 0, 0.1);
  --ice-radius: 6px;
  --ice-transition: all 0.2s ease-in-out;
  --ice-font-size: 14px;
  --ice-font-size-sm: 12px;
  --ice-spacing: 8px;
}

/* --------------------------------
 * 2. Global Reset
 * -------------------------------- */
.ice-container * {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.ice-container {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  line-height: 1.5;
  color: var(--ice-dark);
}

/* --------------------------------
 * 3. Vote Button Styles
 * -------------------------------- */
.ice-vote-container {
  display: inline-flex;
  vertical-align: middle;
  margin: 0 var(--ice-spacing);
  white-space: nowrap;
  float: none;
  width: auto;
  line-height: normal;
}

.ice-vote-box {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 1px solid var(--ice-border);
  border-radius: var(--ice-radius);
  padding: 5px 10px;
  box-shadow: 0 1px 3px var(--ice-shadow);
  max-width: fit-content;
}

.ice-vote-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: var(--ice-transition);
  background: transparent;
  font-size: var(--ice-font-size);
  line-height: 1.5;
  color: var(--ice-gray);
}

.ice-vote-button:hover {
  background: rgba(0, 0, 0, 0.05);
}

.ice-vote-button:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(74, 110, 224, 0.25);
}

.ice-vote-button.ice-upvote {
  color: var(--ice-success);
}

.ice-vote-button.ice-upvote:hover {
  background-color: rgba(40, 167, 69, 0.1);
}

.ice-vote-button.ice-downvote {
  color: var(--ice-danger);
}

.ice-vote-button.ice-downvote:hover {
  background-color: rgba(220, 53, 69, 0.1);
}

.ice-vote-button.active {
  font-weight: bold;
  box-shadow: inset 0 1px 2px var(--ice-shadow);
}

.ice-vote-button.ice-upvote.active {
  color: var(--ice-success);
  background-color: rgba(40, 167, 69, 0.15);
}

.ice-vote-button.ice-downvote.active {
  color: var(--ice-danger);
  background-color: rgba(220, 53, 69, 0.15);
}

.ice-vote-divider {
  width: 1px;
  height: 20px;
  background: var(--ice-border);
  margin: 0 6px;
}

/* --------------------------------
 * 4. Table Styles
 * -------------------------------- */
.ice-table-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 20px;
  border-radius: var(--ice-radius);
  box-shadow: 0 1px 3px var(--ice-shadow);
}

.ice-table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  margin: 1rem 0;
  background: #fff;
  border: 1px solid var(--ice-border);
}

.ice-table td,
.ice-table th {
  border: 1px solid var(--ice-border);
  padding: 12px;
  text-align: left;
  vertical-align: middle;
}

.ice-table thead th {
  background-color: var(--ice-light);
  font-weight: bold;
  border-bottom: 2px solid var(--ice-border);
  color: var(--ice-dark);
}

.ice-table tbody tr:nth-child(even) {
  background-color: rgba(0, 0, 0, 0.02);
}

.ice-table tbody tr:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

/* --------------------------------
 * 5. Responsive Styles
 * -------------------------------- */
@media screen and (max-width: 767px) {
  .ice-table td,
  .ice-table th {
    padding: 8px;
  }
  
  .ice-vote-button {
    padding: 3px 6px;
    font-size: var(--ice-font-size-sm);
  }
  
  .ice-vote-box {
    padding: 4px 8px;
  }
}

/* --------------------------------
 * 6. Print Styles
 * -------------------------------- */
@media print {
  .ice-table {
    border: 1px solid #000;
  }
  
  .ice-table td,
  .ice-table th {
    border: 1px solid #000;
  }
  
  .ice-vote-container {
    display: inline-flex !important;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
}
