/* ScribbleSign Platform - Beautiful, Modern Design System */

:root {
    /* Primary color palette - Elegant greens inspired by nature and growth */
    --primary-color: #10b981;          /* Emerald green - fresh, trustworthy */
    --primary-dark: #059669;           /* Deep emerald for depth */
    --primary-light: #d1fae5;          /* Soft mint for subtle accents */
    --secondary-color: #34d399;        /* Vibrant green - energetic accent */
    --success-color: #10b981;          /* Consistent with primary for harmony */
    --info-color: #3b82f6;             /* Clear blue - informative */
    --warning-color: #f59e0b;          /* Amber - warm attention */
    --danger-color: #ef4444;           /* Clean red - clear warning */
    --light-color: #f8fafc;            /* Soft gray - gentle background */
    --dark-color: #1e293b;             /* Slate - readable, sophisticated */

    /* Surface and container colors */
    --surface-color: #ffffff;          /* Pure white for cards */
    --surface-elevated: #ffffff;       /* Elevated surfaces */
    --header-bg: #f8fafc;              /* Subtle gray for headers */
    --border-color: #e2e8f0;           /* Soft border - not harsh */
    --border-light: #f1f5f9;           /* Even softer borders */

    /* Spacing - generous, breathing room */
    --spacing-xs: 0.5rem;              /* 8px */
    --spacing-sm: 0.75rem;             /* 12px */
    --spacing-md: 1rem;                /* 16px */
    --spacing-lg: 1.5rem;              /* 24px */
    --spacing-xl: 2rem;                /* 32px */

    /* Shadows - soft, elevated, premium feel */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    /* Border radius - smooth, friendly */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
  }
  
  /* Global Styles */
  body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background-color: var(--light-color);
    color: var(--dark-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-size: 1rem;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  /* Generous containers with breathing room */
  .container, .container-fluid {
    padding-left: var(--spacing-lg);
    padding-right: var(--spacing-lg);
  }

  /* Typography - clean, readable, hierarchical */
  h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--dark-color);
    margin-bottom: var(--spacing-md);
    line-height: 1.3;
  }

  h1 { font-size: 2.25rem; font-weight: 800; }
  h2 { font-size: 1.875rem; font-weight: 700; }
  h3 { font-size: 1.5rem; }
  h4 { font-size: 1.25rem; }
  h5 { font-size: 1.125rem; }
  h6 {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -0.01em;
  }

  /* Comfortable spacing for content */
  .row {
    margin-right: -0.75rem;
    margin-left: -0.75rem;
  }

  .row > [class^="col-"] {
    padding-right: 0.75rem;
    padding-left: 0.75rem;
  }
  
  /* Navbar - clean, elevated */
  .navbar {
    background-color: white;
    box-shadow: var(--shadow-sm);
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-light);
    transition: all 0.3s ease;
  }

  .navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: -0.03em;
    color: var(--dark-color);
  }

  .nav-link {
    font-weight: 500;
    font-size: 0.9375rem;
    padding: 0.5rem 1rem !important;
    letter-spacing: -0.01em;
    color: var(--dark-color);
    transition: color 0.2s ease;
  }

  .nav-link:hover {
    color: var(--primary-color);
  }
  
  /* Cards - soft, elevated, beautiful */
  .card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: var(--spacing-lg);
    background-color: var(--surface-color);
    overflow: hidden;
  }

  .card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
    border-color: var(--primary-color);
  }

  .card-header {
    background-color: var(--surface-color);
    border-bottom: 1px solid var(--border-light);
    font-weight: 600;
    font-size: 1rem;
    padding: var(--spacing-lg);
  }

  .card-body {
    padding: var(--spacing-lg);
  }

  .card-footer {
    background-color: var(--header-bg);
    border-top: 1px solid var(--border-light);
    padding: var(--spacing-md) var(--spacing-lg);
  }
  
  /* Buttons - refined, premium feel */
  .btn {
    font-weight: 600;
    font-size: 0.9375rem;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-md);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: -0.01em;
    border-width: 1.5px;
  }

  .btn:focus, .btn:active {
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
  }

  .btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
  }

  .btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1.0625rem;
  }

  /* Button variants */
  .btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    box-shadow: 0 1px 2px 0 rgba(16, 185, 129, 0.05);
  }

  .btn-primary:hover, .btn-primary:focus {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.2);
    transform: translateY(-1px);
  }

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

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

  .btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    transform: translateY(-1px);
  }
  
  /* Forms - clean, accessible, beautiful */
  .form-label {
    font-weight: 600;
    font-size: 0.9375rem;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
    letter-spacing: -0.01em;
  }

  .form-control, .form-select {
    font-size: 1rem;
    padding: 0.625rem 0.875rem;
    border-radius: var(--radius-md);
    border: 1.5px solid var(--border-color);
    background-color: white;
    transition: all 0.2s ease;
    font-family: inherit;
  }

  .form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
    outline: none;
  }

  .form-control-sm, .form-select-sm {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
  }

  .form-text {
    font-size: 0.875rem;
    margin-top: 0.375rem;
    color: #64748b;
  }

  .form-control::placeholder {
    color: #94a3b8;
    opacity: 1;
  }

  /* Input group - refined style */
  .input-group-text {
    background-color: var(--header-bg);
    border: 1.5px solid var(--border-color);
    color: var(--dark-color);
    font-weight: 500;
    border-radius: var(--radius-md);
  }
  
  /* Alerts - soft, informative */
  .alert {
    border: none;
    padding: 1rem var(--spacing-lg);
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    border-left: 4px solid;
  }
  .palert {
    border: none;
    padding: 1rem var(--spacing-lg);
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    border-left: 4px solid;
  }

  .alert-primary {
    background-color: rgba(16, 185, 129, 0.08);
    border-left-color: var(--primary-color);
    color: var(--primary-dark);
  }

  .alert-success {
    background-color: rgba(16, 185, 129, 0.08);
    border-left-color: var(--success-color);
    color: #065f46;
  }

  .alert-danger {
    background-color: rgba(239, 68, 68, 0.08);
    border-left-color: var(--danger-color);
    color: #991b1b;
  }

  .alert-warning {
    background-color: rgba(245, 158, 11, 0.08);
    border-left-color: var(--warning-color);
    color: #92400e;
  }

  .alert-info {
    background-color: rgba(59, 130, 246, 0.08);
    border-left-color: var(--info-color);
    color: #1e40af;
  }
  
  /* Tables - clean, readable data display */
  .table {
    font-size: 0.9375rem;
    margin-bottom: var(--spacing-lg);
  }

  .table th {
    background-color: var(--header-bg);
    font-weight: 600;
    border-bottom: 2px solid var(--border-color);
    color: var(--dark-color);
    font-size: 0.875rem;
    letter-spacing: -0.01em;
  }

  .table th, .table td {
    padding: 1rem var(--spacing-lg);
    vertical-align: middle;
    border-color: var(--border-light);
  }

  .table-sm th, .table-sm td {
    padding: 0.75rem 1rem;
  }

  .table-hover tbody tr:hover {
    background-color: rgba(16, 185, 129, 0.02);
    transition: background-color 0.2s ease;
  }

  .table-striped > tbody > tr:nth-of-type(odd) {
    background-color: rgba(248, 250, 252, 0.5);
  }

  /* Badges - refined, modern */
  .badge {
    font-weight: 600;
    padding: 0.375em 0.75em;
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    letter-spacing: -0.01em;
  }
  
  /* Breadcrumbs - clean navigation path */
  .breadcrumb {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
    margin-bottom: var(--spacing-lg);
    background-color: var(--surface-color);
  }

  .breadcrumb-item + .breadcrumb-item {
    padding-left: 0.5rem;
  }

  .breadcrumb-item + .breadcrumb-item::before {
    padding-right: 0.5rem;
    color: #94a3b8;
  }

  .breadcrumb:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border-color);
  }
  
  /* List groups - clean, modern panels */
  .list-group-item {
    padding: 1rem var(--spacing-lg);
    border-color: var(--border-light);
    transition: all 0.2s ease;
  }

  .list-group-item:first-child {
    border-top-left-radius: var(--radius-md);
    border-top-right-radius: var(--radius-md);
  }

  .list-group-item:last-child {
    border-bottom-left-radius: var(--radius-md);
    border-bottom-right-radius: var(--radius-md);
  }

  .list-group-item-action:hover {
    background-color: rgba(16, 185, 129, 0.02);
  }
  
  /* Document related styles - refined design */
  .document-preview {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background-color: white;
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
  }

  .document-card {
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .document-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
  }

  .document-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    margin-right: 0.75rem;
    font-size: 1.25rem;
  }
  
  /* File type icons */
  .file-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    margin-right: 0.75rem;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
  }

  .file-icon-pdf {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
  }

  .file-icon-doc, .file-icon-docx {
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--info-color);
  }

  .file-icon-xls, .file-icon-xlsx {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
  }

  .file-icon-image {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
  }
  
  /* PDF viewer - clean, modern */
  .pdf-container {
    background-color: var(--header-bg);
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
  }

  .pdf-page {
    display: flex;
    justify-content: center;
    margin-bottom: var(--spacing-lg);
    position: relative;
    background-color: white;
    box-shadow: var(--shadow-md);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
  }

  .pdf-page canvas {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
  }

  /* Signature styles - elegant, refined */
  .signature-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    background-color: rgba(16, 185, 129, 0.02);
    padding: var(--spacing-xl);
    text-align: center;
    margin-bottom: var(--spacing-lg);
    transition: all 0.2s ease;
  }

  .signature-area:hover {
    border-color: var(--primary-color);
    background-color: rgba(16, 185, 129, 0.04);
  }

  .signature-font {
    font-family: 'Brush Script MT', cursive, serif;
    font-size: 1.75rem;
  }

  #signatureCanvas {
    width: 100%;
    cursor: crosshair;
    border: 1.5px solid var(--border-color);
    background-color: white;
    border-radius: var(--radius-md);
  }
  
  /* Activity log - clean, informative */
  .activity-list {
    max-height: 500px;
    overflow-y: auto;
  }

  .activity-item {
    padding: 1rem;
    border-left: 4px solid transparent;
    margin-bottom: 0.75rem;
    background-color: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
  }

  .activity-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateX(4px);
  }

  .activity-item-document {
    border-left-color: var(--primary-color);
  }

  .activity-item-signature {
    border-left-color: var(--success-color);
  }

  .activity-item-share {
    border-left-color: var(--info-color);
  }

  .activity-timestamp {
    font-size: 0.8125rem;
    color: #64748b;
    font-weight: 500;
  }
  
  /* Utilities */
  .cursor-pointer {
    cursor: pointer;
  }
  
  /* Footer - clean, minimalist */
  footer {
    margin-top: auto;
    background-color: white;
    border-top: 1px solid var(--border-light);
    padding: var(--spacing-xl) 0;
    font-size: 0.875rem;
    color: #64748b;
  }

  /* Authentication forms - beautiful, welcoming */
  .auth-form {
    max-width: 440px;
    margin: 3rem auto;
    background-color: white;
    padding: var(--spacing-xl);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-light);
  }

  .auth-form-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
  }

  .auth-form-footer {
    text-align: center;
    margin-top: var(--spacing-xl);
    font-size: 0.9375rem;
  }
  
  /* Shared documents/folders styling */
  .shared-item-container {
    border-left: 4px solid var(--info-color);
    background-color: rgba(59, 130, 246, 0.03);
  }

  /* Status indicators */
  .status-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 0.625rem;
  }

  .status-indicator-draft {
    background-color: #94a3b8;
  }

  .status-indicator-shared {
    background-color: var(--info-color);
  }

  .status-indicator-signed {
    background-color: var(--success-color);
  }

  .status-indicator-expired {
    background-color: var(--danger-color);
  }

  /* Bootstrap components - refined spacing */
  .modal-header, .modal-footer {
    padding: var(--spacing-lg) var(--spacing-xl);
  }

  .modal-body {
    padding: var(--spacing-xl);
  }

  .dropdown-item {
    padding: 0.625rem var(--spacing-lg);
    font-size: 0.9375rem;
    transition: all 0.15s ease;
    border-radius: var(--radius-sm);
    margin: 0 0.25rem;
  }

  .dropdown-item:hover {
    background-color: rgba(16, 185, 129, 0.08);
  }

  .dropdown-header {
    padding: 0.5rem var(--spacing-lg);
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--dark-color);
  }

  .dropdown-menu {
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-lg);
    padding: 0.5rem;
  }

  /* Clean navbar-toggler */
  .navbar-toggler {
    padding: 0.375rem 0.625rem;
    border-color: var(--border-color);
    border-radius: var(--radius-sm);
  }

  .navbar-toggler:focus {
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
    outline: none;
  }

  /* Nav tabs - modern style */
  .nav-tabs {
    border-color: var(--border-light);
  }

  .nav-tabs .nav-link {
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    font-weight: 600;
    font-size: 0.9375rem;
    letter-spacing: -0.01em;
    padding: 0.75rem 1.25rem;
    transition: all 0.2s ease;
  }

  .nav-tabs .nav-link:hover {
    border-color: var(--border-color);
    background-color: rgba(16, 185, 129, 0.02);
  }

  .nav-tabs .nav-link.active {
    border-color: var(--border-light);
    border-bottom-color: white;
    color: var(--primary-color);
  }

  /* Modals - elegant, refined */
  .modal-content {
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-xl);
  }

  .modal-header {
    border-color: var(--border-light);
    background-color: var(--surface-color);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  }

  .modal-footer {
    border-color: var(--border-light);
    background-color: var(--header-bg);
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
  }
  
  /* Responsive adjustments */
  @media (max-width: 767.98px) {
    .container {
      padding-left: var(--spacing-md);
      padding-right: var(--spacing-md);
    }

    .card-header, .card-body, .card-footer {
      padding: var(--spacing-md);
    }

    h1 { font-size: 1.875rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
  }

  /* Custom scrollbar for WebKit browsers - refined, beautiful */
  ::-webkit-scrollbar {
    width: 10px;
    height: 10px;
  }

  ::-webkit-scrollbar-track {
    background: var(--header-bg);
    border-radius: var(--radius-sm);
  }

  ::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: var(--radius-sm);
    border: 2px solid var(--header-bg);
    transition: background-color 0.2s ease;
  }

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

  /* Link styles - consistent, elegant */
  a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
  }

  a:hover {
    color: var(--primary-dark);
  }

  /* Additional refinements for a premium feel */
  * {
    -webkit-tap-highlight-color: rgba(16, 185, 129, 0.1);
  }

  ::selection {
    background-color: rgba(16, 185, 129, 0.2);
    color: var(--dark-color);
  }