/* Publisher Page Styles */

.publisher-main {
  min-height: calc(100vh - 120px);
  padding: 2rem 0;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

/* Publisher Header */
.publisher-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding: 2rem;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.publisher-header-content h1 {
  font-size: 2.5rem;
  color: #1a4d3a;
  margin: 0 0 0.5rem 0;
  font-weight: 700;
}

.publisher-header-content p {
  color: #6c757d;
  font-size: 1.1rem;
  margin: 0;
}

.publisher-stats {
  display: flex;
  gap: 2rem;
}

.publisher-stats .stat-item {
  text-align: center;
}

.publisher-stats .stat-number {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  color: #1a4d3a;
}

.publisher-stats .stat-label {
  color: #6c757d;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Publisher Tabs */
.publisher-tabs {
  display: flex;
  background: white;
  border-radius: 12px;
  padding: 0.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.tab-button {
  flex: 1;
  padding: 1rem 1.5rem;
  border: none;
  background: transparent;
  color: #6c757d;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 500;
}

.tab-button:hover {
  background: #f8f9fa;
  color: #1a4d3a;
}

.tab-button.active {
  background: #1a4d3a;
  color: white;
}

.tab-button i {
  font-size: 1.1rem;
}

/* Tab Content */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Content Type Selector */
.content-type-selector {
  text-align: center;
  margin-bottom: 3rem;
}

.content-type-selector h2 {
  font-size: 2rem;
  color: #1a4d3a;
  margin-bottom: 3rem;
}

.content-type-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  max-width: 1000px;
  margin: 0 auto;
}

.content-type-card {
  background: white;
  padding: 2.5rem 2rem;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  border: 2px solid transparent;
}

.content-type-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  border-color: #1a4d3a;
}

.content-type-card.selected {
  border-color: #1a4d3a;
  background: #f8fffe;
}

.card-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
  background: linear-gradient(135deg, #1a4d3a, #2d6b52);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-icon i {
  font-size: 2rem;
  color: white;
}

.content-type-card h3 {
  font-size: 1.5rem;
  color: #1a4d3a;
  margin-bottom: 1rem;
}

.content-type-card p {
  color: #6c757d;
  line-height: 1.6;
}

/* Content Creation Form */
.content-creation-form {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.form-section {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid #e9ecef;
}

.form-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.form-section h3 {
  font-size: 1.5rem;
  color: #1a4d3a;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

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

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-group label {
  display: block;
  font-weight: 600;
  color: #333;
  margin-bottom: 0.5rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.3s ease;
  background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #1a4d3a;
  box-shadow: 0 0 0 3px rgba(26, 77, 58, 0.1);
}

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

/* Rich Text Editor */
.editor-toolbar {
  display: flex;
  gap: 0.25rem;
  padding: 0.75rem;
  background: #f8f9fa;
  border: 2px solid #e9ecef;
  border-bottom: none;
  border-radius: 8px 8px 0 0;
}

.editor-btn {
  padding: 0.5rem;
  border: none;
  background: transparent;
  border-radius: 4px;
  cursor: pointer;
  color: #6c757d;
  transition: all 0.2s ease;
}

.editor-btn:hover {
  background: #e9ecef;
  color: #1a4d3a;
}

.editor-btn.active {
  background: #1a4d3a;
  color: white;
}

.editor-divider {
  width: 1px;
  background: #dee2e6;
  margin: 0 0.5rem;
}

.rich-editor {
  min-height: 300px;
  padding: 1rem;
  border: 2px solid #e9ecef;
  border-top: none;
  border-radius: 0 0 8px 8px;
  background: white;
  font-size: 1rem;
  line-height: 1.6;
  outline: none;
}

.rich-editor:focus {
  border-color: #1a4d3a;
  box-shadow: 0 0 0 3px rgba(26, 77, 58, 0.1);
}

.rich-editor[placeholder]:empty:before {
  content: attr(placeholder);
  color: #adb5bd;
}

/* File Upload Areas */
.file-upload-area {
  border: 2px dashed #dee2e6;
  border-radius: 8px;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background: #f8f9fa;
}

.file-upload-area:hover {
  border-color: #1a4d3a;
  background: #f0f8f5;
}

.file-upload-area.dragover {
  border-color: #1a4d3a;
  background: #e8f5e8;
}

.upload-placeholder i {
  font-size: 2rem;
  color: #6c757d;
  margin-bottom: 1rem;
}

.upload-placeholder p {
  margin: 0 0 0.5rem 0;
  color: #495057;
  font-weight: 500;
}

.upload-placeholder small {
  color: #6c757d;
}

/* Image Preview */
.image-preview {
  position: relative;
  display: inline-block;
  margin-top: 1rem;
}

.image-preview img {
  max-width: 200px;
  max-height: 200px;
  border-radius: 8px;
  border: 2px solid #e9ecef;
}

.remove-image {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #dc3545;
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
}

/* Form Actions */
.form-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  align-items: center;
  padding-top: 2rem;
  border-top: 1px solid #e9ecef;
}

.form-actions .btn {
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  border-radius: 8px;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

/* Manage Content */
.manage-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.manage-header h2 {
  color: #1a4d3a;
  margin: 0;
}

.manage-filters {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.manage-filters select,
.manage-filters input {
  padding: 0.5rem 0.75rem;
  border: 2px solid #e9ecef;
  border-radius: 6px;
  font-size: 0.9rem;
}

.manage-filters input {
  min-width: 200px;
}

.content-list {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.content-item {
  display: flex;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid #f1f3f4;
  transition: background-color 0.2s ease;
}

.content-item:hover {
  background: #f8f9fa;
}

.content-item:last-child {
  border-bottom: none;
}

.content-thumbnail {
  width: 80px;
  height: 60px;
  border-radius: 6px;
  background: #f8f9fa;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 1rem;
  overflow: hidden;
}

.content-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.content-thumbnail i {
  font-size: 1.5rem;
  color: #6c757d;
}

.content-info {
  flex: 1;
}

.content-title {
  font-weight: 600;
  color: #333;
  margin: 0 0 0.25rem 0;
  font-size: 1.1rem;
}

.content-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.875rem;
  color: #6c757d;
}

.content-status {
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.content-status.draft {
  background: #ffeaa7;
  color: #d63031;
}

.content-status.pending {
  background: #fdcb6e;
  color: #e17055;
}

.content-status.published {
  background: #55efc4;
  color: #00b894;
}

.content-status.archived {
  background: #ddd;
  color: #666;
}

.content-actions {
  display: flex;
  gap: 0.5rem;
}

.content-actions .btn {
  padding: 0.5rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.content-actions .btn-edit {
  background: #74b9ff;
  color: white;
}

.content-actions .btn-delete {
  background: #fd79a8;
  color: white;
}

.content-actions .btn:hover {
  transform: scale(1.05);
}

/* Analytics */
.analytics-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.analytics-header h2 {
  color: #1a4d3a;
  margin: 0;
}

.date-range-selector select {
  padding: 0.5rem 0.75rem;
  border: 2px solid #e9ecef;
  border-radius: 6px;
}

.analytics-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.analytics-card {
  background: white;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.analytics-card .card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.analytics-card h3 {
  color: #6c757d;
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0;
}

.analytics-card .card-header i {
  color: #1a4d3a;
  font-size: 1.2rem;
}

.card-content {
  display: flex;
  align-items: baseline;
  gap: 1rem;
}

.big-number {
  font-size: 2.5rem;
  font-weight: 700;
  color: #1a4d3a;
}

.trend {
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 20px;
}

.trend.positive {
  background: #d4edda;
  color: #155724;
}

.trend.negative {
  background: #f8d7da;
  color: #721c24;
}

.top-content {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.top-content h3 {
  color: #1a4d3a;
  margin-bottom: 1.5rem;
}

.top-content-item {
  display: flex;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid #f1f3f4;
}

.top-content-item:last-child {
  border-bottom: none;
}

.rank-number {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #1a4d3a;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  margin-right: 1rem;
}

.loading-placeholder {
  text-align: center;
  padding: 3rem;
  color: #6c757d;
}

.loading-placeholder i {
  font-size: 2rem;
  margin-bottom: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .publisher-header {
    flex-direction: column;
    text-align: center;
    gap: 1.5rem;
  }

  .publisher-stats {
    justify-content: center;
  }

  .content-type-cards {
    grid-template-columns: 1fr;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .manage-header {
    flex-direction: column;
    align-items: stretch;
  }

  .manage-filters {
    flex-direction: column;
  }

  .manage-filters input {
    min-width: auto;
  }

  .content-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .content-thumbnail {
    align-self: center;
  }

  .content-actions {
    align-self: center;
  }

  .analytics-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .form-actions {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 480px) {
  .analytics-stats {
    grid-template-columns: 1fr;
  }

  .publisher-stats {
    flex-direction: column;
    gap: 1rem;
  }

  .publisher-header-content h1 {
    font-size: 2rem;
  }

  .content-type-selector h2 {
    font-size: 1.5rem;
  }
}

/* Button Styles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: 2px solid transparent;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
  background: none;
}

.btn-primary {
  background: #1a4d3a;
  color: white;
  border-color: #1a4d3a;
}

.btn-primary:hover {
  background: #2d6b52;
  border-color: #2d6b52;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(26, 77, 58, 0.3);
}

.btn-outline {
  color: #1a4d3a;
  border-color: #1a4d3a;
}

.btn-outline:hover {
  background: #1a4d3a;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(26, 77, 58, 0.2);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.btn i {
  font-size: 0.9rem;
}

/* Loading states */
.btn.loading {
  position: relative;
  color: transparent;
}

.btn.loading::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin-left: -8px;
  margin-top: -8px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Success/Error states */
.form-message {
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  display: none;
}

.form-message.success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.form-message.error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.form-message.show {
  display: block;
}

/* Special Content Modal Styles */
.special-content-modal {
  max-width: 600px;
  margin: 5% auto;
}

.special-content-btn {
  background: linear-gradient(135deg, #4a9eff 0%, #357abd 100%);
  border: none;
  color: white;
}

.special-content-btn:hover {
  background: linear-gradient(135deg, #357abd 0%, #2666a3 100%);
  transform: translateY(-1px);
}

.editor-divider {
  width: 1px;
  height: 24px;
  background: #e0e6ed;
  margin: 0 8px;
}

.form-help {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 6px;
  padding: 1rem;
  margin-top: 1rem;
}

.form-help p {
  margin: 0 0 0.5rem 0;
  font-size: 0.9rem;
  color: #6c757d;
}

.form-help p:last-child {
  margin-bottom: 0;
}

.form-help strong {
  color: #495057;
}