/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #fff;
}

/* Header and Navigation */
.app-header {
  background-color: #2c3e50;
  border-bottom: 1px solid #34495e;
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2rem;
  max-width: 1200px;
  margin: 0 auto;
  height: 60px;
}

.nav-brand h1 {
  color: #fff;
  font-size: 1.5rem;
  font-weight: 600;
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-link {
  color: #ecf0f1;
  text-decoration: none;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.nav-link:hover {
  background-color: #34495e;
  color: #fff;
}

/* Main content area */
.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

/* Page header */
.page-header {
  margin-bottom: 2rem;
}

.page-header h1 {
  font-size: 2rem;
  font-weight: 600;
  color: #2c3e50;
}

/* Table styles */
.table-container {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.data-table th {
  background-color: #f8f9fa;
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  color: #2c3e50;
  border-bottom: 2px solid #e9ecef;
}

.data-table td {
  padding: 1rem;
  border-bottom: 1px solid #e9ecef;
}

.data-table tbody tr:hover {
  background-color: #f8f9fa;
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

/* Button styles */
.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  border-radius: 4px;
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background-color: #3498db;
  color: white;
}

.btn-primary:hover {
  background-color: #2980b9;
  color: white;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 3rem;
  color: #6c757d;
}

.empty-state p {
  font-size: 1.1rem;
}

/* Breadcrumb */
.breadcrumb {
  font-size: 0.9rem;
  color: #6c757d;
  margin-bottom: 0.5rem;
}

.breadcrumb a {
  color: #3498db;
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

/* Society details */
.society-details {
  margin-bottom: 2rem;
}

.detail-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
}

.detail-card h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 1rem;
  border-bottom: 1px solid #e9ecef;
  padding-bottom: 0.5rem;
}

.detail-row {
  display: flex;
  margin-bottom: 0.75rem;
}

.detail-row:last-child {
  margin-bottom: 0;
}

.detail-row .label {
  font-weight: 600;
  color: #495057;
  min-width: 80px;
}

.detail-row .value {
  color: #212529;
}

/* Share movements section */
.share-movements-section {
  margin-top: 2rem;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.share-movements-section h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #2c3e50;
  margin: 0;
}

.holder-link {
  color: #3498db;
  text-decoration: none;
  font-weight: 500;
}

.holder-link:hover {
  color: #2980b9;
  text-decoration: underline;
}

.balance {
  font-weight: 600;
  color: #2c3e50;
  font-family: 'Courier New', monospace;
}

/* Share ledger section */
.share-ledger-section {
  margin-top: 2rem;
}

.share-ledger-section h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 1.5rem;
}

.society-ledger {
  margin-bottom: 2rem;
}

.society-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #e9ecef;
}

.society-ledger h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #2c3e50;
  margin: 0;
}

.society-ledger h3 a {
  color: #3498db;
  text-decoration: none;
}

.society-ledger h3 a:hover {
  color: #2980b9;
  text-decoration: underline;
}

.current-balance {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.balance-label {
  font-size: 0.9rem;
  color: #6c757d;
  font-weight: 500;
}

.balance-amount {
  font-family: 'Courier New', monospace;
  font-weight: 600;
  color: #2c3e50;
  font-size: 1.1rem;
  background-color: #f8f9fa;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  border: 1px solid #e9ecef;
}

.ledger-table {
  font-size: 0.9rem;
}

.ledger-table th {
  text-align: center;
}

.ledger-table td {
  text-align: center;
}

.ledger-table td:nth-child(1) {
  text-align: left;
}

.ledger-table td:nth-child(5) {
  text-align: left;
  max-width: 300px;
}

.quantity-cell {
  font-family: 'Courier New', monospace;
  font-weight: 500;
  color: #27ae60;
}

.quantity-cell:not(:empty) {
  background-color: #d5f4e6;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

.balance-cell {
  font-family: 'Courier New', monospace;
  font-weight: 600;
  color: #2c3e50;
}

.detail-cell {
  font-size: 0.85rem;
  color: #6c757d;
}

.empty-state.small {
  padding: 1.5rem;
}

.empty-state.small p {
  font-size: 1rem;
}

/* User management styles */
.role-badge {
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.role-badge.admin {
  background-color: #dc3545;
  color: white;
}

.role-badge.viewer {
  background-color: #6c757d;
  color: white;
}

.holder-type-badge {
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.holder-type-badge.persona {
  background-color: #3498db;
  color: white;
}

.holder-type-badge.sociedad {
  background-color: #1a73e8;
  color: white;
  font-weight: bold;
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
}

.btn-danger {
  background-color: #dc3545;
  border-color: #dc3545;
  color: white;
}

.btn-danger:hover {
  background-color: #c82333;
  border-color: #c82333;
  color: white;
}

.form-help {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.8rem;
  color: #6c757d;
  font-style: italic;
}

/* Form styles */
.form-container {
  max-width: 600px;
  margin: 0 auto;
}

.form-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  padding: 2rem;
}

.movement-form {
  max-width: 100%;
}

.form-row {
  margin-bottom: 1.5rem;
}

.form-group {
  width: 100%;
}

.form-label {
  display: block;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.form-control {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 0.95rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-control-static {
  padding: 0.75rem;
  background-color: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 4px;
  color: #495057;
  font-weight: 500;
}

.radio-group {
  display: flex;
  gap: 2rem;
  margin-top: 0.5rem;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.form-radio {
  margin: 0;
}

.radio-label {
  font-weight: 500;
  color: #495057;
  cursor: pointer;
}

.form-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e9ecef;
}

.btn-large {
  padding: 0.75rem 2rem;
  font-size: 1rem;
}

.btn-secondary {
  background-color: #6c757d;
  color: white;
}

.btn-secondary:hover {
  background-color: #545b62;
  color: white;
}

/* Error messages */
.error-messages {
  background-color: #f8d7da;
  border: 1px solid #f5c6cb;
  border-radius: 4px;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.error-messages h3 {
  color: #721c24;
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.error-messages ul {
  margin: 0;
  padding-left: 1.5rem;
  color: #721c24;
}

.error-messages li {
  margin-bottom: 0.25rem;
}

/* Responsive design */
@media (max-width: 768px) {
  .navbar {
    flex-direction: column;
    height: auto;
    padding: 1rem;
  }
  
  .nav-brand {
    margin-bottom: 1rem;
  }
  
  .nav-links {
    gap: 1rem;
  }
  
  .main-content {
    padding: 1rem;
  }
}

.ownership-tree {
  margin-top: 2rem;
}

.ownership-tree ul {
  list-style: none;
  margin-left: 20px;
  padding-left: 15px;
  border-left: 1px solid #ccc;
}

.society-node > strong {
  font-size: 16px;
  display: block;
  margin-bottom: 5px;
}

.holder-node.persona {
  color: #2c3e50;
}

.holder-node.sociedad {
  color: #1a73e8;
  font-weight: bold;
}

.holder-label {
  display: inline-block;
  margin: 4px 0;
}

.holder-link {
  color: #1a73e8;
  text-decoration: none;
  font-weight: bold;
}

.holder-link:hover {
  text-decoration: underline;
}