/* 
 * RedRock CodeCamp Portfolio - Shared Styles
 * Modern, clean, centered design for all portfolio projects
 */

:root {
  --primary-color: #2563eb;
  --primary-dark: #1e40af;
  --secondary-color: #64748b;
  --success-color: #10b981;
  --danger-color: #ef4444;
  --warning-color: #f59e0b;
  --bg-light: #f8fafc;
  --bg-white: #ffffff;
  --text-dark: #1e293b;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --max-width: 1200px;
}

/* 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: var(--text-dark);
  background: var(--bg-light);
  padding: 2rem 1rem;
  min-height: 100vh;
}

/* Container */
.container,
.portfolio-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1rem;
}

/* Card Layouts */
.card,
.portfolio-card,
.project-card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 2rem;
  margin-bottom: 2rem;
  transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover,
.portfolio-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* Headers */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-dark);
  margin-bottom: 1rem;
  font-weight: 600;
  line-height: 1.2;
}

h1 {
  font-size: 2.5rem;
  text-align: center;
  margin-bottom: 2rem;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

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

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

label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--text-dark);
}

input[type="text"],
input[type="url"],
input[type="email"],
input[type="number"],
input[type="date"],
input[type="file"],
textarea,
select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: var(--bg-white);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

textarea {
  min-height: 120px;
  resize: vertical;
}

/* Buttons */
button,
.btn,
input[type="submit"] {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  text-decoration: none;
  text-align: center;
}

button:hover,
.btn:hover,
input[type="submit"]:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

button:active,
.btn:active,
input[type="submit"]:active {
  transform: translateY(0);
}

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

.btn-secondary:hover {
  background: #475569;
}

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

.btn-success:hover {
  background: #059669;
}

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

.btn-danger:hover {
  background: #dc2626;
}

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

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.125rem;
}

/* Results Display */
.result,
.output,
.response {
  background: var(--bg-light);
  border-left: 4px solid var(--primary-color);
  padding: 1.5rem;
  border-radius: var(--radius-md);
  margin: 1.5rem 0;
  font-family: 'Courier New', monospace;
  white-space: pre-wrap;
  word-break: break-word;
}

.success {
  border-left-color: var(--success-color);
  background: #f0fdf4;
  color: #166534;
}

.error {
  border-left-color: var(--danger-color);
  background: #fef2f2;
  color: #991b1b;
}

.warning {
  border-left-color: var(--warning-color);
  background: #fffbeb;
  color: #92400e;
}

/* Lists */
ul, ol {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

li {
  margin-bottom: 0.5rem;
}

.list-unstyled {
  list-style: none;
  margin-left: 0;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  background: var(--bg-white);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

thead {
  background: var(--primary-color);
  color: white;
}

th {
  padding: 1rem;
  text-align: left;
  font-weight: 600;
}

td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
}

tbody tr:hover {
  background: var(--bg-light);
}

/* Code Blocks */
code {
  background: var(--bg-light);
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
  color: var(--danger-color);
}

pre {
  background: var(--text-dark);
  color: #e2e8f0;
  padding: 1.5rem;
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin: 1.5rem 0;
}

pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}

/* Alerts */
.alert {
  padding: 1rem 1.5rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  border-left: 4px solid;
}

.alert-info {
  background: #eff6ff;
  border-left-color: var(--primary-color);
  color: var(--primary-dark);
}

.alert-success {
  background: #f0fdf4;
  border-left-color: var(--success-color);
  color: #166534;
}

.alert-warning {
  background: #fffbeb;
  border-left-color: var(--warning-color);
  color: #92400e;
}

.alert-danger {
  background: #fef2f2;
  border-left-color: var(--danger-color);
  color: #991b1b;
}

/* Grid Layout */
.grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

/* Flex Utilities */
.flex {
  display: flex;
}

.flex-center {
  display: flex;
  justify-content: center;
  align-items: center;
}

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.flex-col {
  flex-direction: column;
}

.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.gap-4 { gap: 2rem; }

/* Spacing Utilities */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

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

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

/* Text Utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary-color); }
.text-success { color: var(--success-color); }
.text-danger { color: var(--danger-color); }
.text-warning { color: var(--warning-color); }

.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }

.font-bold { font-weight: 600; }
.font-normal { font-weight: 400; }

/* Loading Spinner */
.spinner {
  border: 3px solid var(--border-color);
  border-top: 3px solid var(--primary-color);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 2rem auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Badge */
.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 9999px;
  background: var(--primary-color);
  color: white;
}

.badge-success { background: var(--success-color); }
.badge-danger { background: var(--danger-color); }
.badge-warning { background: var(--warning-color); }
.badge-secondary { background: var(--secondary-color); }

/* Links */
a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.2s;
}

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

/* Header Navigation */
.header-nav {
  background: var(--bg-white);
  padding: 1rem 0;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius-lg);
}

.header-nav a {
  margin: 0 1rem;
  font-weight: 500;
}

/* Footer */
.footer {
  text-align: center;
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 768px) {
  body {
    padding: 1rem 0.5rem;
  }
  
  h1 {
    font-size: 2rem;
  }
  
  h2 {
    font-size: 1.5rem;
  }
  
  .card,
  .portfolio-card {
    padding: 1.5rem;
  }
  
  .grid {
    grid-template-columns: 1fr;
  }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-light: #1e293b;
    --bg-white: #0f172a;
    --text-dark: #f1f5f9;
    --text-muted: #94a3b8;
    --border-color: #334155;
  }
  
  body {
    background: var(--bg-light);
    color: var(--text-dark);
  }
}
